title: Subscription list function

text: I have created a function which automatically adds users with the role of contributor to a list in which they will receive forum (modified mingleforum plugin) updates by email. My problem is that the function called by the function `is_player_subscribed()' doesn't seem to be working properly as it effectively adds the entire list each time a user registers.               add_action( 'user_register', 'call_forum_subscribe_member_player' );          function forum_subscribe_member_player()     {         $players= get_users();              foreach($players as $player)         {             $user_info = get_userdata($player->ID);             $playeremail = $user_info->user_email;                  if(!empty($playeremail) && user_can( $player-> ID, 'contributor'))             {                                    $list = (array)get_option('mf_forum_subscribers_1');                                      if( is_player_subscribed($player->ID)) //remove player if already exists (user clicked unsubscribe)                 {                     $key = array_search($playeremail, $list);                     unset($list[$key]);                 }                 else                     $list[] = $playeremail;                 update_option('mf_forum_subscribers_1', $list);             }         }            }          function is_player_subscribed($user_ID)     {         if($user_ID)           {             $useremail = get_userdata($user_ID, 'user_email');                  $list = (array)get_option('mf_forum_subscribers_1');             if(!empty($list) && in_array($useremail, $list))             {               return true;             }             return false;           }          }          function call_forum_subscribe_member_player()     {         forum_subscribe_member_player();     }      I am trying to determine why it seems to be ignoring the second function and am guessing that it has something to do with the `$user_ID`parameter. I would greatly appreciate more experienced eyes having a look. I should note that the function is adapted from the one in the plugin which also modifies the same option. I put the class used in a gist with the modified code in a separate file if anyone is curious or needs more information to answer the question: gist Edit: var dump $list after `$list = (array)get_option('mf_forum_subscribers_1');` gives me:               array(1) { [0]=> string(2) " " }     array(2) { [0]=> string(2) " "                 [1]=>  string(13) "name@name.com" }      array(3) { [0]=> string(2) " "                 [1]=> string(13) "name@name.com"                 [2]=> string(15) "name2@name2.com" }      array(4) { [0]=> string(2) " "                 [1]=> string(13) "name@name.com"                 [2]=> string(15) "name2@name2.com"                 [3]=> string(15) "name3@name3.com" }       etc. etc... When I look in `wp_options` I get `a:41:{i:0;s:2:` which coincides with the number of contributors plus one.


title: Custom menus created but does not show up in admin panel

text: I am developing a theme of my own. In `functions.php` I added -               add_action( 'init', 'register_my_menus' );           function register_my_menus() { register_nav_menus( array(                   'front_login_menu' => _( 'front_login_menu location'),              'top_front_general_menu' => _( 'top_front_general_menu'),              'top_general_menu' => _( 'top_general_menu'),              'top_student_menu' => _( 'top_student_menu'),              'top_admin_menu' => _( 'top_admin_menu'),               'top_trainer_menu' => _( 'top_trainer_menu' ) ) ); }      Then I created the custom menus in the admin panel. But suddenly I found that those menus except one are not visible in the right side of the `Appearance -> Menus` page in online server but the theme locations do exist. But those menus are visible in my localhost. I was supposed to create them (some if not all) in online server too. If I want to create one of those missing menus then the message says: > _**The menu name .... conflicts with another menu name. Please try > another._** How can I get those menu names appear in the right side of the theme locations?


title: Mobile Menu Not Working

text: The mobile menu stopped working after I updated WP to the latest version, I assume it has to do with a customization of the theme. http://kvintage.com/ Wondering if anyone could please take a quick look and guide me through fixing this error! The theme is Twenty Thirteen. Thanks!


title: Looking up custom taxonomy IDs by name

text: I have a custom post type, 'fee', which has a custom taxonomy, 'fee-category'. I'm trying to look up IDs for items in the taxonomy by name. Should I not be able to get it using `get_term_by()`? Something like this: `get_term_by('name', 'Sample Name', 'fee-category')` I even tried just looking for taxonomies by ID, using IDs I know exist and no luck. Anyone know which function I should be using? Perhaps there's something in my code registering the taxonomy? Here it is:                 add_action( 'init', 'create_fee_taxonomy' );            function create_fee_taxonomy() {         // Add new taxonomy, make it hierarchical (like categories)         $labels = array(                 'name' => _x( 'Fee Category', 'taxonomy general name' ),                 'singular_name' => _x( 'Fee Category', 'taxonomy singular name' ),                 'search_items' => __( 'Search Fee Categories' ),                 'all_items' => __( 'All Fee Categories' ),                 'parent_item' => __( 'Parent Fee Category' ),                 'parent_item_colon' => __( 'Parent Fee Category:' ),                 'edit_item' => __( 'Edit Fee Category' ),                 'update_item' => __( 'Update Fee Category' ),                 'add_new_item' => __( 'Add New Fee Category' ),                 'new_item_name' => __( 'New Fee Category Name' ),                 'menu_name' => __( 'Fee Category' ),         );              register_taxonomy( 'fee-category', array( 'fee' ), array(                 'public' => true,                 'hierarchical' => true,                 'labels' => $labels,                 'show_ui' => true,                 'show_admin_column' => true,                 'query_var' => true,         ) );     }


title: Add filter on html tags,attributes on specific function in wordpress

text: Title is little bit :S sorry :) For example,we have paginate links function that output html something like this               some number      How can I filter that,to remove that span,class,to apply my own html tags,styles,tnx in advance.I just want to apply my own styles and html tags,is this possible?


title: Display CPT index page as front/home page

text: I'm building a website that's sole purpose is to display other websites (defined in the CPT). Think of it as a portfolio site for a company's digital assets. I have already defined the CPT and added websites to it. I created a `portfolio-archive.php` template (the CPT's name). Which is now accessed at the `/portfolio` slug. I want this to be the homepage of the site. How would I go about doing that?


title: Problem with content - not loading

text: So, this is my problem... Everything in my wordpress website is up and running, except when I get into a post and the content simply doesn't load. Everything else does, except for the post content. This happened when I was trying to install a content locker from incent.ly and I came up into a problem: I didn't know how to install different lockers into different posts, as the code had to be pasted before the tag. So.. I downloaded and installed a plugin called: "custom field template", apparently very known around the community, and what I did was:   * Insert the content locker code into a "template content" area and in the "Post-id" I put the id of the post I wanted to lock. And bam, every post stopped working. Now, I've uninstalled the plugin and the problem remains. And I just don't know where to look for the problem. I have ran the debug test on a post and, in the area where the content should be, this appeared: > "Warning: `call_user_func_array()` expects parameter 1 to be a valid > callback, function '`add_post_content`' not found or invalid function name > in `/var/www/vhosts/gentlefantasies.com/httpdocs/wp-includes/plugin.php on > line 173`"


title: Can't create a SubMenu

text: Hi everyone I have created a new WordPress blog at http://www.shanytopper.com and I have a problem. I am using a wp_nav_menu for the main menu in mywebsite (I added the suppert to the theme myself), and it works great, but when I'm at the admin page and trying to make a submenu (some catagories need to be under some other ones) it doesn't seem to work. Specificaly, it doesn't allow me to drag the menu item "sideways", and thus create the second tier. It only allow me to change the order the items show on the menu but on the same tier. Anyone have any idea on what my cause this? I have tried using a different Theme (that already has Menus support), and yet the problem remains, so I'm doubtfull it's something I did. Thanks in advance. Shany topper


title: Insert all post IDs in new database table

text: I have a plugin which creates a new database table. Upon activating the plugin is there a way to insert all my posts ids into that table? Right now I'm using an action hook to immediately insert the id of new posts I publish.               function transfer_post_id($post_ID)  {     global $wpdb;        if (!($wpdb->get_row("SELECT post_id FROM $my_table WHERE post_id = $post_ID" ) ) ) { //if post id not already added           $wpdb->insert( $my_table, array( 'post_id' => $post_ID ) );              }        return $post_ID;     }          add_action ( 'publish_post', 'transfer_post_id' );      However there are posts before activating the plugin that I need a way to insert without manually updating each one.


title: Translation update successful but apparently not

text: I was updating my multi site installation just minutes ago to WordPress 4.0. The dashboard keeps notifying me, of an available translation update. I updated it as well and it gave me a success message. When reloading the update page, it is still there for update. The status never changes. There will be the one translation update available forever. Anyone else has this problem?


title: Resetting comment count

text: Recently, I had to move to another domain and had to recreate all my MySQL tables on the enw server. I noticed that for some posts, the number of comments is doubled. Example - http://inversekarma.in/scraps/you-dont-mess- with-the-rajinikanth/. In the above post, there's only 4 comments, but the comment count shoes 8 comments. I am not sure it is not a theme-related issue, as this happens only for a few posts. Can someone show me how to write a MySQL query to recount the comments for all posts? Or maybe a plugin?


title: Replace the Post Excerpt Meta Box with a Field in My Custom Meta Box

text: I've got a custom meta box for a custom post type which will be the only metabox I plan to show in the main column (except the native title box). I want to move the native Expert box/field inside my Custom Meta Box. I'm able to create a field called Excerpt in my Meta Box, however I only know how to save this to the Custom Fields, not the original location that the native Except saves to.


title: Admin bar still there after I remove it

text: So I've tried like three different solutions:                   remove_action('init', 'wp_admin_bar_init');         add_filter( 'show_admin_bar', '__return_false' );              function remove_admin_bar_css() {             show_admin_bar( false );             remove_action('wp_head', '_admin_bar_bump_cb');         }              add_action('admin_bar_init', 'remove_admin_bar_css');      However, the admin bar is still there. I'm a WP beginner. Maybe I'm misunderstanding what the admin bar is? Is this it? http://wpmu.org/wp- content/uploads/2010/09/wordpress-admin-bar.jpg ? The black bar on the top? I'm sure I am editing the right functions file too, since I just `echo 'hello'`ed and it showed up. However, the black bar on the top (the thing I want to remove) is not disappearing. I am using WP 3.5.2, upgrading from 3.2.1.


title: Add a twitter feed to my Wordpress website

text: My website is WilsonsTransportation. On the left hand side of my site we have "testimonials" scrolling down. I've located the coding for that in my custom theme under `page-home.php`. I was hoping to add a twitter feed underneath or above the testimonials that are showing. The code is quite long but I can post it if needed. Thanks!


title: How to add jQuery script to an individual page?

text: I have this code which I want to add into a specific page of mine. I don't want to create a file for it and then include etc (though do tell if that would be the only way). Also I don't want it to be in the header as it would be included in all pages. The code is:               <script type="text/javascript">     $(function () {         $('input[name=done]:radio').click(function () {             if ($(this).val() === "Yes") {                 $('#p-days').show();             } else {                 $('#p-days').hide();             }         });         $('input[name=already-b]:radio').click(function () {             if ($(this).val() === "Yes") {                 $('#div-name').show();             } else {                 $('#div-name').hide();             }         });     });     </script>      I added this in the editor by selecting the Text (not in Visual mode.) But it is not working. Any ideas what I'm doing wrong? Thanks.


title: Find proper "text domain" within theme

text: I have a client with a wordpress theme, Nevada, and we are having trouble making the built in translations work for it. The theme contains .mo files for English, German, and Slovenian, and appear to be found by our WPML plugin. However, they are not translating any of the template text inside the theme. Translations of content we have created is working fine. Following the instructions here: http://wpml.org/documentation/getting- started-guide/theme-localization/ , looking at section "Option 2: Using a .mo file for theme localization", it sounds like all I need to do is enter the `textdomain` for the theme. Problem is, I don't know what it is, or how to find it. I tried digging through the theme files themselves but any text output is abstracted away behind many many layers of functions. To make matters worse, neither I or my client have a support account with the theme providers (but we do have a valid license!) and they are not being helpful at all. How can I find the text domain to make WPML work with this theme? **Update** When I open one of the .po files I see lines like:               #: template-part-teaser.php:41     #@ Nevada     msgid "404 Error"     msgstr "404 Error"      So I tried entering "Nevada" as the textdomain in the WPML plugin, but this did not change anything for me


title: Simply Exclude - Category feed exclusion is excluding from category feed instead of just the main feed

text: I am using Simply Exclude to make sure that certain categories do not show up on the home page and in the sites main feed, http://example.com/feed. However, excluding the category from the main feed also excludes posts from the category's feed, http://example.com/category/category-73/feed/. How do I get it so that the main feed has these categories excluded but the category's feed remains populated?


title: Email Notifications of new posts to users - suggestions

text: I currently am using the Subscriber2 plugin to send email notifications to subscribers of new blog posts, but that plugin has not been working properly for a while on my site. Can someone suggest some alternative plugins. I only need the following... \- sends emails with part of the post to subscribers on a mailing list \- sidebar widget so new subscribers can enter their email address to sign up \- import feature so I can take emails and import them into this new system Thanks.


title: Determine if a navigation item has children

text:
I am trying to determine if an item has a sub-item with depth 1 or higher. I cannot find anywhere if there is some function/query I can write that grabs the current item looks in the database if it has any sub-pages and returns `true`. What I aim to do with this is give the `<li>` class a different class depending on the fact if the menu item has a sub-item. The snippet out of the code for what i have so far:               if ($depth == 0)      {         if( /*page has subpages*/ )         {                 $class_names = $class_names ? ' class="menu-enable"' : '';         }         else         {                 $class_names = $class_names ? '' : '';         }     }     else     {         $class_names = $class_names ? ' class="sub-menu-enable"' : '';     }      Now I need some code that runs at _page has sub-pages_. How can I detect parent items? **Edit:** Full custom walker class now:                class header_walker extends Walker_Nav_Menu     {      /**      * @see Walker::start_lvl()      * @since 3.0.0      *      * @param string $output Passed by reference. Used to append additional content.      * @param int $depth Depth of page. Used for padding.      */     function start_lvl( &$output, $depth = 0, $args = array() ) {         $indent = str_repeat("\t", $depth);         $output .= "\n
$indent

\n";     }          /**      * @see Walker::end_lvl()      * @since 3.0.0      *      * @param string $output Passed by reference. Used to append additional content.      * @param int $depth Depth of page. Used for padding.      */     function end_lvl( &$output, $depth = 0, $args = array() ) {         $indent = str_repeat("\t", $depth);         $output .= "$indent

\n";     }          /**      * @see Walker::start_el()      * @since 3.0.0      *      * @param string $output Passed by reference. Used to append additional content.      * @param object $item Menu item data object.      * @param int $depth Depth of menu item. Used for padding.      * @param int $current_page Menu item ID.      * @param object $args      */     function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) {              $indent = ( $depth ) ? str_repeat( "\t", $depth ) : '';              $class_names = $value = '';         $classes = empty( $item->classes ) ? array() : (array) $item->classes;         $classes[] = 'menu-item-' . $item->ID;              $class_names = join( ' ', apply_filters( 'nav_menu_css_class', array_filter( $classes ), $item, $args ) );         $class_names = $class_names ? ' class="' . esc_attr( $class_names ) . '"' : '';                 /*         // values of depth         echo $item->title.' - ';         echo $depth.'
';         echo $class_names;              if ($depth == 0)          {             if( check for subpage )             {                 $class_names = $class_names ? ' class="menu-enable"' : '';             }             else             {                 $class_names = $class_names ? '' : '';             }         }         else         {             $class_names = $class_names ? ' class="sub-menu-enable"' : '';         }*/              $output .= $indent . '
';              $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 );     }     /**      * @see Walker::end_el()      * @since 3.0.0      *      * @param string $output Passed by reference. Used to append additional content.      * @param object $item Page data object. Not used.      * @param int $depth Depth of page. Not Used.      */     function end_el( &$output, $item, $depth = 0, $args = array() ) {         $output .= "
\n";     }      }


title: "Blog pages show at most" in The Loop

text: I remember in another theme I did, that the The Loop automatically looped for the number that was set in "Blog pages show at most" (Settings->Reading). The theme I am working on right now does not see to consider this number and loops for an infinite amount of time (and crashes of course). How do I make it to consider "Blog pages show at most" ?


title: Change Woothemes admin url

text: I would like to change the next url: `wp-admin/admin.php?page=woothemes` I would like that " **woothemes** " to be anything else. Is that possible without breaking the site?


title: Get custom post archived by meta field value in wordpress

text: I am using `cpt-archive` plugin to generate archive by month in my wordpress post. Here the plugin using this code,                       $query = "SELECT YEAR(post_date) AS `year`, MONTH(post_date) AS `month`, count(ID) as posts FROM $wpdb->posts $join $where GROUP BY YEAR(post_date), MONTH(post_date) ORDER BY post_date DESC $limit";                      $arcresults = $wpdb->get_results($query);      Here it's working fine with post_date. I need to customize this to get archived by meta fields. I have two meta keys such as `_event_start_date` and `_event_end_date`.


title: wp-cli is not working properly. No response from commands

text: I am trying to make a copy of a live site on a test server. I installed wp-cli and wp-cli sometimes works and sometimes doesn't. When it doesn't work, it just returns nothing. Not one character of output. I can view the website, apache, php and mysql all seem to be working. I turned on `WP_DEBUG` in `wp- config.php` and I see a couple of minor errors, as follows: > PHP Notice: wpdb::escape is **deprecated** since version 3.6! Use > wpdb::prepare() or esc_sql() instead. in /var/www/wp-includes/functions.php > on line 3083 Notice: wpdb::escape is **deprecated** since version 3.6! Use > wpdb::prepare() or esc_sql() instead. in /var/www/wp-includes/functions.php > on line 3083 I have tried `wp-cli --debug` The only command that works is `wp-cli --info` This is the output of `wp-cli`, in case that is helpful. PHP binary: `/usr/bin/php5`   PHP version: 5.5.3-1ubuntu2.3   php.ini used: `/etc/php5/cli/php.ini`   WP-CLI root dir: `phar://wp-cli.phar`   WP-CLI global config:   WP-CLI project config:   WP-CLI version: 0.15.0 Every once in a while, a command will work. This is very strange.


title: Custom Fields on User Dashboard?

text: I was thinking about either getting a plugin or shortcode to create custom field that shows on user and allows admin to change them and edit the information, not users. For example, if we have wp site where 5 members are registered under admin and there are tasks that admin wants to show in their profile page. so there has to be non editable text area. so that member can view the task if they are logged in. It could show either on dashboard page or any other specific non editable widget. Is it possible? any pointers for this particular task? links?


title: Create dashboard setting which lets me set ID of category which is inserted into template

text: Part of a function i'm using in my single.php page is `$myposts = get_posts(array('numberposts' => 10, 'offset' => 0,'post_status'=>'publish','category' => 32));` I need to make the number `32` dynamic so it can be set from the dashboard I'm familiar with advanced custom fields for posts. Is there a similar plugin that would let me create custom options? Or can someone suggest a good modern tutorial on creating a basic option like this in the dashboard Thanks


title: How to set back query var author_name after unset it?

text: I am unsetting the query var `author_name` for querying posts in the author template page. I am using `pre_get_posts` to filter the main query. After the query is run, I need to set back the `author_name` query var. This is where I unset it.               function wpquery( $query )          if ( $query->is_author() && $query->is_main_query()) {                     $query->set( 'post_status', $post_status );                     unset( $query->query_vars['author_name'] );                      $tax_query = array(                           array(                             'taxonomy' => 'tax',                             'field' => 'name',                             'terms' => $var                         )                     );                     $query->set( 'tax_query', $tax_query );             }        add_action( 'pre_get_posts', 'wpquery' );      After the query runs, i have to set `author_name`


title: How to list all categories in three divs dynamically based on the quatity of categories?

text: I have 15 categories. I list this using `<div class="category_list"><ul><li><?php wp_list_categories();?></li></ul></div>` Now it's listing all 15 categories into a single div which is category_list. I am trying to print these categories 5 by 5 in three divs. like: `<div class="category_list">first 5 categories here </div>` `<div class="category_list">6th to 10th categories here </div>` `<div class="category_list">11th to 15th categories here </div>` Those divs are float next to each other I can do that using CSS.   But how can I achieve that HTML markup using PHP coding? Any help will be very much appreciated. Thanks in advance.


title: Stop link being removed in menu/list when viewing that post

text:
I am using the following code in a widget that displays the posts in that category, but when I view that link by clicking it, it disapears from the menu/list. Take a look here               <?php     $my_query = new WP_Query("category_name=$pagename&showposts=200&orderby=title&order=ASC"); ?>
     <?php while ($my_query->have_posts()) : $my_query->the_post(); ?>
<a href="<?php the_permalink() ?>" title="<?php the_title(); ?>">     <?php the_title(); ?>
     <?php endwhile; ?>
       I want the list static, not keep changing. How?


title: How do I add some javascript validation to the admin interface form's onsubmit?

text: I have a plugin that adds meta boxes to the admin interface and I need to do some validation when the user presses the "update" button before the form is submitted. Is there a WordPress action or hook to add my function to the form's onsubmit? Or do I need to simply do this: **Pseudo code**               var myInput = document.getElementById( "myMetaBoxInput" );          //Get form from input     var form = myInput.form;          //They have something already set     if ( form.onsubmit )     {         var previousSubmit = form.onsubmit;              form.onsubmit = function() {             //do my code....                  //Call their function             previousSubmit();         }     } else form.onsubmit = myfunction;      The problem with doing the above is that it's possible that wordpress could have some code that happens on the "update" button's "click" action which will set the form's `onsubmit` to another function and clear mine out.


title: Define size for `get_post_gallery_images`, they seem to have been resized to 150x150

text:
I'm using `get_post_gallery_images` and it's spitting images out as 150x150. It doesn't look like it takes a size parameter, so I assumed it would just spit out the largest image or preferably one of my defined sizes. 150x150 is too small though, is there somewhere I can declare what size gallery images I want? For instance I'm doing:               <?php     $gallery = get_post_gallery_images( $post );      foreach ($gallery as $img) { ?>
<img src="<?php echo $img; ?>" />
     <?php } ?>      All of these images are coming out as 150x150, is there something I'm missing?


title: why do I have to use required parametres?

text: Why, when I want to use               add_filter( 'author_link', 'foo', 10, 3 );     function foo ( $link, $author_id, $author_nicename ) {}      I have to use 3 required parametres? Why cant I do this:               add_filter( 'author_link', 'foo' );     function foo ( $author_id ) {}      If you can, please give me some literature about this. PS beginner in WP.


title: exclude posts from a custom category

text: I have made a custom category "card_categories". I want to exclude some posts from that category on the category page. For eg :- category id 51 has posts with id's 1,2,3,4,5,6,7,8,9 Now I want that on the category page it should show posts only with post id 4,5,6,7,8,9 So, Is it possible that i can exclude posts from a category.


title: How to display only feautured/sticky listings on the homepage

text:
I want on my homepage on my first page to be displayed only featured listings no matter how old they are This is my homepage code:                  <?php get_header(); ?>          <?php     if(get_option('aven_home') == "listing") { ?>        <?php include (TEMPLATEPATH . '/lib/listhome.php'); ?>     <?php } else { ?>
          <?php     $temp = $wp_query;     $wp_query= null;     $wp_query = new WP_Query();     $wp_query->query('paged='.$paged);     ?>     <?php while ($wp_query->have_posts()) : $wp_query->the_post(); ?>             <div class="post" id="post-<?php the_ID(); ?>">

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

         Posted by <?php the_author(); ?>    <?php the_time('M - j - Y'); ?> <?php comments_popup_link('0 Comment', '1 Comment', '% Comments'); ?>

          <?php     if ( has_post_thumbnail() ) { ?>         <a href="<?php the_permalink() ?>"><img class="postimg" src="<?php bloginfo('stylesheet_directory'); ?>/timthumb.php?src=<?php get_image_url(); ?>&h=150&w=200&zc=1" alt=""/>     <?php } else { ?>         <a href="<?php the_permalink() ?>"><img class="postimg" src="<?php bloginfo('template_directory'); ?>/images/dummy.png" alt="" />     <?php } ?>     <?php wpe_excerpt('wpe_excerptlength_index', ''); ?>

          <?php endwhile; ?>

          <?php getpagenavi(); ?>          <?php $wp_query = null; $wp_query = $temp;?>
     <?php } ?>     <?php get_sidebar(); ?>          <?php get_footer(); ?>


title: Plugins that restrict access based on user group/roles

text: I'm quite shocked to learn that out of all the Restrict Access plugins for WordPress, there's not one I can find that suits my needs. Basically I have two requirements: Do not display the page in wp_list_pages and Do not display the page in search results. I tried 7 plugins: Members, Advanced Access Manager, Restrict Content, Page Security, Maven Member, User Access Manager, and WordPress Access Control. Advanced Access Manager was the only plugin that restricted the page from being displayed on the wp_list_pages. WordPress Access Control is the only plugin that explicitly addressed the search issue. Am I going to have to use 2 plugins to meet my requirements?


title: Drop down menus with wp_nav_menu or wp_page_menu

text:
i have some doubts on what i am actually supposed to use to create drop down menus.By just looking at theme twenty ten,i have ,
                   <?php /*  Allow screen readers / text browsers to skip the navigation menu and get right to the good stuff */ ?>
<a href="#content" title="<?php esc_attr_e( 'Skip to content', 'twentyten' ); ?>"><?php _e( 'Skip to content', 'twentyten' ); ?>
                     <?php /* Our navigation menu.  If one isn't filled out, wp_nav_menu falls back to wp_page_menu.  The menu assiged to the primary position is the one used.  If none is assigned, the menu with the lowest ID is used.  */ ?>                     <?php wp_nav_menu( array( 'container_class' => 'menu-header', 'theme_location' => 'primary' ) ); ?>
      In the comments its written **"If one isn't filled out, wp_nav_menu falls back to wp_page_menu..."** When writing the css for the drop down menus,does it mean i have to write one for the menus created in the apprerance->menus wp admin backend and one for when the navigation from the wp admin backend is not available.


title: Change url of posts with keywords

text: I have a website which is using general URL of word press like https://mywebsite.org/item/itempostname Every category post have a location. So i want to modify general URL to custom URL like https://mywebsite.org/alaska/itempostname Here Alaska,Chicago etc is a location. Add location URL : `http://mywebsite/wordpress/wp-admin/edit- tags.php?taxonomy=item-location&post_type=item` ![enter image description here](http://i.stack.imgur.com/B5TH6.png) Is this possible ? Is this possible with any plugin ? I need your help on this topic.


title: One Custom Post Type two different Templates

text: I have a custom post type with some metaboxes, for this CPT have his own single-CPT.php where I show his content and metaboxes and url domain.com/CPT. But what I need to know is if posible to create a second template where I only show the metaboxes content of this CPT and url domain.com/CPT/metaboxes Hope it make sence and have a solution :P Thanx to all.


title: Custom wp_editor doesn't update post_content

text: I'm working on a client's site, creating a staff profile plugin. The issue is that they previously created the profiles as regular posts. I converted all of the staff posts into a custom post types. In order to customize the post admin I followed Dipesh Kc's solution to customize the default editor. I wanted to use the existing content for the staff posts, but customize the editor, removing the media uploader and other options. UPDATE: While I successfully was able to change the default editor settings, and the post content is being displayed in the editor. I hooked `wp_update_post` into the `save_post` hook, thinking that what I'm editing is the `post_content` in a new custom metabox. When I update the post, I basically get a fatal error, memory exhausted warning, though when I check the database, the `post_content` does get updated with my edits. The relevant sections of my plugin code are included below based on gicolek's gist and also by looking at the WP codex page for `wp_update_post`:               public function __construct() {             add_action( 'add_meta_boxes', array($this, 'meta_boxes' ));             add_action( 'save_post', array($this, 'save_bio_data' ), 10, 1);         }                   // Modify default content editor              /**          * Adds a box to the main column on the Post edit screen uses modified editor          *           * @hook add_meta_boxes          * @see http://codex.wordpress.org/Function_Reference/add_meta_box           */          public function meta_boxes()         {             global $_wp_post_type_features;                       //check for the required post type page or post or <custom post type(here article)                   if (isset($_wp_post_type_features['tn_cstm_people']['editor'])) {                     unset($_wp_post_type_features['tn_cstm_people']['editor']);                     add_meta_box(                         'tn_cstm_people_bio',                         __('Bio'),                         // To address callback function in a class                         array($this, 'bio_editor_meta_box'),                         'tn_cstm_people', 'normal', 'core'                     );                 }         }              public function bio_editor_meta_box($post)             {                    // Use nonce for verification                 wp_nonce_field( plugin_basename( __FILE__ ), 'tn_cstm_noncename' );                           $settings = array(                     'media_buttons' => false,                     'textarea_name'=>'tn_cstm_bio',                     'tabindex' => '4',                     'teeny' => true                 );                      wp_editor($post->post_content,'tn_cstm_bio', $settings);         }                        /**          * When the post is saved, save our customized post data           *           * @hook save_post          */         public function save_bio_data($post_id) {                  // check if we're on the cpt page and if the nonce has been set             if ( !isset( $_POST['post_type'] ) or !isset( $_POST['tn_cstm_noncename'] ) ) {                 return;             }                  // check if the we're on the custom post page             if ( !in_array( $_POST['post_type'], array( 'tn_cstm_people' ) ) ) {                 return;             }                  // if we're doing an auto save return             if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE )                 return;                  // verify nonce for the safety reasones             // @see http://codex.wordpress.org/WordPress_Nonces             if ( !wp_verify_nonce( $_POST['tn_cstm_noncename'], plugin_basename( __FILE__ ) ) )                 return;                  /* Make sure that current user has proper rights to save the post              *@see Caution! in http://codex.wordpress.org/Function_Reference/wp_update_post                *Otherwise would generate multiple (hundreds of copies of the post)              */                  if ( !current_user_can( 'edit_post', $post_id ) )                 return;                             /* Verify that post type is not set to revision and that $post object needs to be updated                     *http://codex.wordpress.org/Function_Reference/wp_update_post                     */                       if ( ! wp_is_post_revision( $post_id ) ) {                          // unhook this function so it doesn't loop infinitely                     remove_action('save_post', 'save_bio_data');                          // update the post, which calls save_post again                          $data_content = $_POST['tn_cstm_bio'];                     $my_post = array();                     $my_post['ID'] = $post_id;                     $my_post['post_content'] = $data_content;                          wp_update_post( $my_post );                          // re-hook this function                     add_action('save_post', 'save_bio_data');                 }                       }      Does anyone know why the post_content isn't updating? Any insights would be appreciated.


title: link generated term list to latest post of term

text:
i use the following code to generate a unordered list of all terms within a taxonomy and a nested list with all posts of the terms direct under the lsit item of the term
                  <?php                     $custom_terms = get_terms('project_category', 'hide_empty=0');                     foreach($custom_terms as $custom_term) {                         wp_reset_query();                             $args = array('post_type' => 'project',                                 'tax_query' => array(                                     array(                                         'taxonomy' => 'project_category',                                         'field' => 'slug',                                         'terms' => $custom_term->slug,                                     ),                                 ),                             );                          $loop = new WP_Query($args);                         if($loop->have_posts()) {                                  echo '

'.$custom_term->name.'';                                         //if($custom_term->slug == $current_term){                             ?>
                             <?php                              while($loop->have_posts()) : $loop->the_post();                             echo '
'.get_the_title().'
';                              endwhile;                               ?>
                             <?php                         }                         } // endif                        // } //endif                             ?>
      how can i link the the terms to the latest post within that term? i managed to link to the taxonomy.php displaying the latest post, but due to some issues i have to link it directly.


title: Exclude current post ID from loop in sidepbar.php

text:
Currently all the below bit of code is doing is showing 3 random posts from the same category that the current page resides in. So if the current page falls in the artists category, for example, show 3 random posts from the artists category down the side of the page. The problem I have is that the current post keeps appearing within this section, I'd like to exclude it but can't work out how to do this using my current loop. Here's my loop:               <?php if ( in_category( 'artists' ) ) {  ?>
Similar articles
                     <?php // Display the 3 random posts from page category                     query_posts('showposts=3&cat=1,-12&orderby=rand'); ?>                  <?php } ?>                  <?php if ( in_category( 'people' ) ) {  ?>
Similar articles
                     <?php // Display the 3 random posts from page category                     query_posts('showposts=3&cat=3&orderby=rand'); ?>                  <?php } ?>                  <?php if ( in_category( 'development' ) ) {  ?>
Similar articles
                     <?php // Display the 3 random posts from page category                     query_posts('showposts=3&cat=5&orderby=rand'); ?>                  <?php } ?>                  <?php if ( in_category( 'offsite' ) ) {  ?>
Similar articles
                     <?php // Display the 3 random posts from page category                     query_posts('showposts=3&cat=7&orderby=rand'); ?>                  <?php } ?>                  <?php if ( in_category( 'projects' ) ) {  ?>
Similar articles
                     <?php // Display the 3 random posts from page category                     query_posts('showposts=3&cat=6&orderby=rand'); ?>                  <?php } ?>                  <?php if ( in_category( 'contact' ) ) : // Display nothing ?>                      <?php // Else, show boxes                 else : ?>                          <?php while (have_posts()) : the_post(); ?>                              <?php foreach( get_the_category() as $cat ) echo '
slug . '" data-category="' . $cat->slug . '" >'; ?>                                    <a href="<?php the_permalink()?>" title="<?php the_title(); ?>">

                                     <?php the_post_thumbnail(); ?>
                                   <?php                                   $sub_title=get_post_meta($post->ID,'subtitle',true);                                   if($sub_title != '') {                                   echo '
'. get_the_title() .' / '. $sub_title .'
';                                   } else {                                   echo '
'. get_the_title() .'
';                                   }                                   ?>                                        <?php                                   // Call in the contents of a custom field called Excerpt and if custom field in admin panel is empty don't display
 tags otherwise wrap contents in
 tags                                   $excerpt=get_post_meta($post->ID,'Excerpt',true);                                   if($excerpt != '') {                                   echo '
'. $excerpt .'
';                                   } else {                                   echo ' ';                                   }                                   ?>
<?php the_time('YdmHi') ?>

                          <?php endwhile;?>                  <?php endif; ?>


title: Custom Wordpress SQL Query 4 posts per custom taxonomy

text: I'm currently developing a Wordpress website that has a large navigation that lists the 4 most recent posts within a hierarchical taxonomy. I dont have any experience with $wpdb, but it seems like that would be the most efficient way to get results for many taxonomies as opposed using many WP_Query s for each tax... this site also gets a considerable amount of traffic. I am using transients API and caching other things well... So basically to reiterate, I'm trying to do this:   1) I have 22 terms within a custom taxonomy. 2) I need to select the 4 most recent posts within each term 3) I need the title, the post thumbnail, and the permalink 4) These are all going to be either posts or pages Any tips or help is hiiiighly appreciated. thank you


title: Categories to A News Page

text: I'm trying to use categories to get all my posts (within a category-news) to go to the NEWS page on my site. I've created the category 'news' with some posts and a 'category-news.php' file which is copied from category.php but I'm not sure how to get the posts to go to the news page. I've tried following the steps from various forums from people who've tried to do something similar but I'm having no success copying them. If i go to mypage.com/category/news I can see my posts there. But what I would like to acheive is to go to mypage.com/news and the categories would be there. Does anyone know what further steps I have to take to get this working? Thanks, Ciaran


title: I can't preview post's change once they are published

text: The preview function works fine when posts are just draft. The url looks like this : http://exemple.domain.com/blog/?p=12&preview=true Then when I pubish my posts, let's say I want to change something and preview it, the url looks like this : http://exemple.domain.com/blog/my-article- title/?preview=true&preview_id=12&preview_nonce=514e88946a&post_format=standard The problem is it does reflect any changes ... I use WordPress 3.9.2 running Twenty Fourteen theme without any plugins ## EDIT I've turn the permalink to default and it resolve the problem. But I need it to work using the pretty url ... Thanks for your help


title: How to stop wordpress to make the default query?

text: My goal is a redirect to a custom template based on some new rewrite rule, but without having wordpress to make unusefull queries. my code:               function add_rewrite_rules() {              add_rewrite_rule(             '^settore/([^/]*)/?$',             'index.php?settore=$matches[1]',             'top'         );            add_rewrite_tag('%settore%','(caldareria|tessile)');     }     add_action( 'init', 'add_rewrite_rules' );          function set_root_category_template($template){         $settore = get_query_var('settore');         if($settore != '') $template = locate_template('root-taxonomy.php');         return $template;     }     add_filter('template_include','set_root_category_template',99);      It redirects just right, but if I check $wp_query->posts in root-taxonomy.php, I see a list of regular post. Instead, in that page I'll make a custom query asking for some specific taxonomy terms data, and therefore, the default query is totally useless. How can I stop it? After all, I'm not passing any default query var to index.php so I can't understand the reason why wp is still doing a query..


title: How can i remove all html tags from get_the_content()?

text: i want to remove all html tags from content like `<p>, <br>, <img>, <a>` i `tried strip_tags()` also tried               $content = get_the_content();     $content = apply_filters('the_content', $content);      but not working for me. any reliable solution ??


title: Why am I seeing 'true' next to these timestamps?

text:
Click on the Beers tab on this page: http://beernews.org/brewery/sierra- nevada-brewing/ UPDATE: Here is the Pastebin for Excerpt.php. Note that excerpt.php is called in other places on the site (like the home page and the first tab on the link above and no 'true' appears.) Here's the code:
             <?php               $post_obj = $wp_query->get_queried_object();         $post_ID = $post_obj->ID;         $post_title = $post_obj->post_title;         $brewery_slug = $post_obj->post_name;         $args = array('post_type' => 'beer',             'tax_query' => array(                 array(                     'taxonomy' => 'brewery',                     'field' => 'slug',                     'terms' => $brewery_slug                 )             )         );              $query = new WP_Query( $args ); ?>              <?php if ( $query->have_posts() ) : while ( $query->have_posts() ) : $query->the_post(); ?>                  <?php get_template_part( 'excerpt', get_post_format() ); ?>                  <?php endwhile; ?>                      <?php wp_reset_query(); ?>                      <?php twentyeleven_content_nav( 'nav-below' ); ?>                      <?php else :?>

<?php echo 'Click above to zoom in. Area is still in development so no posts yet. Try the specs tab.';?>

          <?php endif;          // Prevent weirdness     wp_reset_postdata();     ?>


title: Advice on naming files for a plugin

text: Based on some advice I read[1], I have meticulously named all my plugin php files with my adopted plugin prefix, being 'wpsm-' in this case. All my class files have the additional 'class' qualifier, making their prefix 'wpsm- class-'. Now, while doing some early morning housekeeping, trying to get zoned into serious coding, I realised that as long as all my php files stay in my plugin's folder, there is no reason to prefix them all, and removing the prefix actually improves readability. Further, if I place all my class files in a 'code' or 'class' folder, I don't need the additional 'class' prefix. What do readers of this question suggest for my naming conventions, in the context I describe above? > [1] Professional WordPress Plugin Development: > > "When building a custom plugin, it’s essential that you prefix everything > with a unique prefix. This means all plugins files, function names, variable > names, and everything included with your plugin."


title: WordPress Stripping Colons?

text: I'm souping up a WP theme with the BuddyPress plugin to make a cool hybrid of sorts between the two. Anyway... I'm using the following to grab author RSS urls. **The problem being the colon ":" is being stripped on the pages and I can't figure out why. Does anybody have a solution for this?**               <a href="<?php echo "http://"; bloginfo('url'); ?>/author/<?php echo $curauth->display_name; ?>/feed/">My RSS Feed      I have also tried simply adding http:// before the php grab of the URL, an it still strips it. I'm assuming this is a WP or BuddyPress problem.


title: show the post of all child category in different single page

text: i have parent category ('photogallery') that have 5 child category like latest,sports,business etc i wanted to show the post of that child category in another single php file that should be by the name of parent category and display the post of all child category post mean i just wanted to create only 1 single page by the name of parent category, i write code in function.php but its not working exactly as per my need as per that code i have to create multiple single pages by the id of that category means i have to create single page for each child category like single-23.php, single-62.php etc here is my code inside function.php`               add_filter('single_template', create_function('$t', 'foreach( (array) get_the_category() as $cat ) { if ( file_exists(TEMPLATEPATH . "/single-{$cat->term_id}.php") ) return TEMPLATEPATH . "/single-{$cat->term_id}.php"; } return $t;' ));


title: Convert WordPress date format to jQuery UI Datepicker format

text: I wrote the following function to convert the current WordPress date format into a format that can be recognized by the jQuery UI Datepicker: From: http://codex.wordpress.org/Formatting_Date_and_Time To: http://docs.jquery.com/UI/Datepicker/formatDate               /**       * Convert a date format to a jQuery UI DatePicker format        *       * @param string $dateFormat a date format       * @return string       */      function dateFormatTojQueryUIDatePickerFormat($dateFormat) {               $chars = array(              // Day             'd' => 'dd', 'j' => 'd', 'l' => 'DD', 'D' => 'D',             // Month              'm' => 'mm', 'n' => 'm', 'F' => 'MM', 'M' => 'M',              // Year              'Y' => 'yy', 'y' => 'y',          );               return strtr((string)$dateFormat, $chars);      }       Anyone know of any easier/built-in way to accomplish this?


title: CSS of the admin panel

text: Where can i get hold of the CSS of the admin panels? Id like to make it look different on my development environment so that no one changes the production server by mistake. Like giving it a different background-color.


title: Is it safe to pass directory path to plugins_url()?

text: `plugins_url()` function accepts plugin slug or file path to build URL for. I have following directory structure:               /wp-content/mu-plugins/someplugin/css/file.css     /wp-content/mu-plugins/someplugin/includes/file.php      I need to build URL to `file.css` in `file.php`. I can't pass `__FILE__` because that will be one level too deep.               plugins_url('css/file.css', __FILE__ )      I can pass `__DIR__` to get correct level and it seems to work, but it's not documented as allowed and I am not sure there isn't something to bite me later with this.               plugins_url('css/file.css', __DIR__ )      So, is this adequate? Any better way to build URL for these conditions?


title: How to add 'use_desc_for_title = 0' to all wp_list_categories calls?

text: My category descriptions are extremely long, so I don't want the descriptions to be used in the title attribute of my category lists. However, WP does this automatically when it outputs the default category widget in the markup. Is it possible to add a filter in functions.php that assigns the default value for 'use_desc_for_title' to 0? (The default is 1)?


title: WP-DownloadManager - Query most download per week/month etc

text: I'm using this plugin (http://wordpress.org/extend/plugins/wp- downloadmanager/) as my download manager. While it's very simplistic and does great for what i need, the statistics to output on the site lack a little. The only useful function really is: Display Most downloaded (of all time). While i do use this, it would be handy to have a Most downloaded this week or this month as new files get lost on the all time ranks. I've dug through the code and found this query for the most downloaded function:               $files = $wpdb->get_results("SELECT * FROM $wpdb->downloads WHERE file_permission != -2 ORDER BY file_hits DESC LIMIT $limit");      I'm not sure if it's possible as i haven't a clue about mysql but can we simply add something to that line to query most downloaded files during this week or month? More info on the plugin here: http://lesterchan.net/wordpress/readme/wp- downloadmanager.html (Click on the usage tab) Thanks


title: How to filter manage categories listing

text: I'm successfully using the function below to trim the length of my category descriptions when viewing the manage category screen (thanks Rarst). Suppose I want to remove children of the "uncategorized" category from this listing. Would I simply insert a check in the for loop below to skip over those child items? UPDATE: With Rarst's tip on using unset(), I've amended the code below with the correct bits to remove specific categories from the manage categories listing...               //Clean up description summaries on Category manage edit table     add_action( 'admin_head-edit-tags.php', 'admin_edit_tags' );     function admin_edit_tags()      {       add_filter( 'get_terms', 'admin_trim_category_description', 10, 2 );     }     function admin_trim_category_description( $terms, $taxonomies )      {     if( 'category' != $taxonomies[0] )return $terms;     foreach( $terms as $key=>$term )     {     $terms[$key]->description = strip_tags(substr( $term->description, 0, 75 ))."...";     //new bits here     if($terms[$key]->term_id == 1){unset($terms[$key]);}     }     return $terms;     }


title: GUID field in wp_posts - relevance for attachments?

text: How significant is the guid field in wp_posts? I'm doing a migration and adding a lot of images to the table (via `wp_insert_attachment, wp_generate_attachment_metadata and wp_update_attachment_metadata`), but the guid field isn't filled by default. Should i correct this?


title: How to conditionally include a custom field on category editor screen not category "add" screen

text: The "manage categories" screen has two interfaces, one when you first click on "Categories" which is used to add a new category and another once you click on an existing category to edit it. I've added some custom fields to the Category editor, but I only want them to be present on the edit screen, not the "add" screen. However $pagenow in both cases, is the same (edit-tags.php). The only difference I can see is that when editing, the action=edit token appears on the querystring. Should I simply wrap my "edit_category_form" filter in a test for the existence of that token or is there a better way? PS: I'd be fine with leaving the fields on the add screen, however, it appears that the save is ajaxed, and none of my custom fields are being saved in that routine.


title: How to alter the order of custom form fields

text:
I've added a "Custom Title" field to the Category editor in order to capture a keyword friendly title that can be used separately from the category name. It works great, but it appears as the last input element of the category screen. Ideally, I would like it to sit under the "Name" field (or at the very top). Is this possible? Here's the code I'm using to add my custom input field to the category edit screen...               if($pagenow == "edit-tags.php" && $_REQUEST['action'] == "edit")      add_filter('edit_category_form', 'my_category_fields');          function my_category_fields($tag) {     $tag_extra_fields = get_option(MY_CATEGORY_FIELDS);?>

             Full Category Title	             <input name="categoryTitle" id="categoryTitle" type="text" size="40" aria-required="false" value="<?php echo $tag_extra_fields[$tag->term_id]['cat_title']; ?>" />
The title is optional but will be used in place of the name on the category landing page.

     <?php     }


title: How to create a custom shortcode for custom login form?

text:
I am trying to create a shortcode for the login form to use on a page. I have manage to get a simple form, but am looking to add the "forgot password link" Here is what I have so far ... any way to add to this to have the form with the forgot link?               add_action( 'init', 'onco_add_shortcodes' );          function onco_add_shortcodes() {              add_shortcode( 'onco-login-form', 'onco_login_form_shortcode' );     }          function onco_login_form_shortcode() {              if ( is_user_logged_in() )             return '
You are already logged in!
';              return wp_login_form( array( 'echo' => false ) );     }


title: Nginx + WordPress + HHVM: Why isn't Batcache working? Would Varnish help even more?

text: I've heard great things about **HHVM** , so I've setup a copy of WordPress blog (on another domain) with Nginx (with the Pagespeed module) and HHVM. Right now the benefits are obvious: on the same config, load times are between two and three times faster. I'm trying to speed up things a little bit, and I've also installed **Memcached and Batcache**. I've installed the **memcached** package, copied _object-cache.php_ (Pastebin) onto the root folder of the WordPress blog, and after that I've installed the Batcache plugin and copied the _advanced- cache.php_ (Pastebin) file onto the _wp-content_ folder. Also, I've included the line               define('WP_CACHE', true);      in the _wp-config.php_ file. It seems it doesn't work, though. If I **quickly reload the page several times** Batcache should show the cached page, but it doesn't. It's easy to check that by reloading (Cmd+R on Chrome on OS X) the page several times and then viewing the page's code. Under the `<head>` section I should see some batcache stats, but they aren't there. I wonder if someone could give me some hint on this. On a side note, I don't know if I could add some other component in order to help the performance be even better. I'm thing about **Varnish** , but I'm not sure if it's just useless and it's just another way to the same I'm currently doing. Any other component there? (I'll test **CDN for images, minifying js, etc** and some other tricks as well, but I'm talking from the server perspective).


title: How to make an sql query to exclude everything but custom taxonomy terms in table wp_terms?

text: ## Problem Summary: I am trying to write a SQL query that returns only my custom taxonomy terms, but the table (wp_terms) contains _all_ of the terms, even ones that I don't want (such as category terms, and nav_menu terms). * * * **This is my present query:**               function myajax_inputtitleSubmit_func() {     global $wpdb;     global $customTerms;          $acInput = $_GET['input'];     $mydb = new wpdb('','','','');//commented out on purpose     // check nonce     $nonce = $_GET['nextNonce'];         if ( ! wp_verify_nonce( $nonce, 'myajax-next-nonce' ) )         die ( 'Busted!');               //$custTermQuery = "SELECT slug FROM wp_47_terms";     $custTermQuery = "SELECT slug FROM wp_47_terms WHERE slug LIKE '%" . $acInput . "%'";          $customTerms = $wpdb->get_results($custTermQuery);           // generate the response     //$response = json_encode( $_GET );     $response2 = json_encode( $customTerms );     $acInput_encoded = json_encode( $acInput );               // response output     header( "Content-Type: application/json" );     //echo $response;     echo ($response2);     //echo ($acInput_encoded);          // IMPORTANT: don't forget to "exit"     exit;      } * * * **This is my table wp_47_term_taxonomy:** ![This is my table wp_47_term_taxonomy:](http://i.stack.imgur.com/GNMMe.jpg)   * As you can see, my query gets all slugs even things like footer1, utility-links, and uncategorized. I don't want that. I only want the slugs that are part of my custom taxonomy `wcmc_keywords`. **This is my table wp_47_terms:** ![wp_47_term_taxonomy](http://i.stack.imgur.com/3UzWj.jpg)   * I believe this table can be used somehow in a query to only show slugs with the taxonomy `wcmc_keywords`. This table shows association between 'Taxonomy' and 'term_id'.  * * * ## CONCLUSION: I am trying to use WordPress tables and SQL queries to obtain only the slugs of my custom taxonomy. Unfortunately, I am new at SQL queries, and even though I feel like I am on the right track, I would please like some help understanding what changes I need to make to my query.


title: Disable multisite-wide plugins on specific sites

text: On a multisite network, I have some plugins that are network activated so they run on every site in the network. However, I want to disable all of the network active plugins on some of the sites. How can I do this?


title: How to create a title images for different posts?

text: I've recently started with wordpress theme development and have come up with a few different post templates but there's one thing I'm still unsure how to do - that is, having a post specific image appear before the post header, one that would be affected by css separate to that of the images found in the post body via attachments. Any suggestions would be appreciated.


title: wordpress to import joomla articles

text: I am using wordpress plugin `Joomla 1.5 Importer` to import articles from joomla. My joomla version is 1.5, but when i tried to import i get this error               Warning: mysqli::mysqli() [mysqli.mysqli]: (HY000/2003): Can't connect to MySQL server on 'www.ashramyoga.com' (110) in /home/aaa/public_html/aaa/aaa/wp-content/plugins/joomla-15-importer/joomla-15-importer.php on line 177


title: How to customize wordpress sidebar widget

text:
**This is how i registered my sidebar:**               register_sidebar(array(             'name' => 'Post Sidebar',             'before_widget' => '

',             'after_widget' => '

',             'before_title' => '
',             'after_title' => '
',         ));      **The problem I have:** Title div wrapped inside widgetdiv. The above code output like this.

My title

      **My requirement:**
My title

      I mean titlediv should be outside widgetdiv Can anyone give me good solution?. Thanks


title: Fetching Image from other post/page with custom type

text:
I'm building a theme that display image according to a category. Exemple, There a Fashion section, which is a page. On that page I have uploaded photo related to fashion. Another page is Portraits, which display portrait photography and so on. On my home page I would like to display all the recent photo that I have uploaded through the other section/page. Right now I can only show image related to a specific page or post with this script:               <?php if ( have_posts() ) : while ( have_posts() ) : the_post();               $args = array(        'post_type' => 'attachment',        'numberposts' => -1,        'post_status' => null,        'post_parent' => $post->ID       );            $attachments = get_posts( $args );          if ( $attachments ) {             foreach ( $attachments as $attachment ) {                echo '
';                echo wp_get_attachment_image( $attachment->ID, 'full' );                echo '
';                echo apply_filters( 'the_title', $attachment->post_title );                echo '

';                    }          }           endwhile; endif; ?>      How can I extend this script to fetch images/photos in other post/page? I would like to specified that I'm kind of new in theme developement... Thanks in advance for your help.


title: Display Child Categories of Current Post ID

text: I'm starting to love this place more and more, super helpful! Anyway, todays dilemma is as such: I want to display as a list the child terms only, of a specific parent term, of a custom taxonomy, that apply to the current ID within the loop. As such i want to print the children terms of the parent term 'Mens' for the taxonomy 'size' that apply to my current post id in the loop. Hopefully my that is unambiguous enough. Preferably i would like them returned linked to their category page. But since i couldnt crack this issue my self, im happy for anything you guys have to offer. I know how to get all of the terms, or just a specific taxonomies terms, but not this, not at all. Thank you Mike


title: Custom metabox translation

text: I have created a custom post types and added some custom metaboxes and now I am wondering witch translation plugin I use for my site? I don't have experience with none of them, so I don't know who will support my custom metaboxes and who will not.


title: hide wp-content from urls

text: Here is what I am thinking of trying to hide wp-content from the urls of files included in page source. defining the following in wp-settings.php               define ('WP_CONTENT_URL','http://example.com/myownfoldername');      and adding this to `.htaccess`               RewriteRule ^myownfoldername/(.*) /wp-content/$1 [QSA,L]      This seems to work fine with no additional plugins on localhost `but will it work seamlessly on the online site with a few plugins. I am more concerned about w3 total cache. I guess I need now worry about a few reference of wp-content in database as even if it exists there it is still a valid link?


title: Author template help. How to check if field exists in the profile?

text:
I'm coding my author template. I want something like this               <?php if(Author filled about me)) { ?>
About me

<?php echo about me; ?>

                             <?php } ?>      I tried this code. But its not working.               <?php if(isset($curauth->description)) { ?>
About me

<?php echo $curauth->description; ?>

                             <?php } ?>      CAn anyone help me? Thanks


title: How can I publish a post with two or more authors?

text: A friend and I have a Wordpress blog and we want to be able to publish a post with more than one author. How can I do this?


title: Per site configuration

text: I'm building a custom theme that I will reuse on more than one site and would like to be able to configure some things from the admin. For example setting the Twitter and Facebook pages links without hardcoding them in the template. What's the best way to do this? Should I put them in wp-config or should I have some sort of custom fields? These settings should be global to one site.


title: WordPress archives widget causes Bing bot 404 errors

text: I'm using the standard WordPress Archives widget in dropdown mode on my blog. But apparently the Microsoft Bing spider gets confused by it, because the dropdown code looks like this:               <select name="archive-dropdown" onchange='document.location.href=this.options[this.selectedIndex].value;'>     ... <option/> ... </option> ... </option> ...     </select>      In the Redirection plugin, it shows a ton of 404 errors due to a spider from Redmond pinging darn near every page and post on my site asking for a "this.options[this.selectedIndex].value;" file. What's the best way to fix this problem? Should I use a different widget? Is there a way to tell the spider to knock it off? (To be clear: I do want my pages indexed, but I don't want to deal with a with all the 404 issues)


title: $wpdb->insert not working in any way

text: I know this type of question has been asked over and over, but I couldn't find a solution for my problem, so I hope you can help me. I am using WP 3.3. and I have created a custom table. Now I want to insert some data into it, but I can't get it working. This is my code:               global $wpdb;     $table_name = $wpdb->prefix . "my_data";     $wpdb->insert($table_name, array(                 'my_id'     => NULL,             'my_day'    => $day,             'my_month'  => $month,             'my_abbr'   => $abbr,             'my_venue'  => $venue,             'my_geo'    => $geo_one.", ".$geo_two,             'my_artist' => $artist,             'my_link'   => $link                     )                     );      I am trying to insert data for several hours now without luck. To my eyes the code is correct, but I guess I am just mussing something important here. Any pointers would be appreciated! Thank you


title: FromName --> ReplyTo Name wordpress multisite contact form

text: When the form email lands in my inbox, I would like the "from email" (FromName) to reflect the senders email address name. This is with the popular recaptcha form plugin: http://wordpress.org/plugins/recaptcha-form/ Instead, the email comes in with the mother-site-tld.com domain - the name of the multisite not even the subsite - in the fromname field, which makes it a pain to reply to. Yet this works fine and dandy on other multisites I have and I cannot recall going to any great lengths to get it to work correctly ever before ... Thanks Phillip


title: Custom image size not selectable in uploader

text: I want to add a custom image size for each image, that is uploaded into posts (via the uploader). I found code-examples on several websites, but somehow they just don't work for me. This is (the relevant part of) my code inside the functions.php:               function ts_custom_image_sizes(){         add_theme_support('post-thumbnails');         add_image_size('ts-menu', 122, 62, true);       }     add_action('after_theme_setup', 'ts_custom_image_sizes');          function ts_choose_custom_images($sizes) {           $custom_sizes = array(               'ts-menu' => __('Image for the menu right', 'tsdomain')         );         return array_merge( $sizes, $custom_sizes );       }     add_filter('image_size_names_choose', 'ts_choose_custom_images');      I have to mention that my option is displayed in the uploader of wordpress, but it's greyed out (not selectable). And there's no image created in the uploads-folder with the dimensions I set (122x62), just with the standard- dimensions. I also tried to disable the theme and reload it, but that didn't help, too.


title: How do I remove the admin bar (styling) from frontend only?

text: When logged in, the admin bar adds the following to my page `<head>` section:               <style media="screen" type="text/css">         html { margin-top: 28px !important; }         * html body { margin-top: 28px !important; }     </style>      Now, I can remove this by disabling the admin bar               /* Disable the Admin Bar. */     add_filter( 'show_admin_bar', '__return_false' );      or removing it completely               /* Remove admin bar */     remove_action('init', 'wp_admin_bar_init');      I would like to keep the admin bar in the admin interface and only remove the CSS from front end. I already use CSS reset where I set `margin: 0px`, but the admin-bar styling overrides this. So how can I remove the styling from front end? PS. I know I can disable the admin bar per user, but that's not what I want.


title: How to hide media uploads by other users in the Media menu?

text: Simply put - how might I completely hide media files uploaded by any other users other then themselves? Id like to disable access to these links & files since they are a way for non-admin users to be able to access and edit a custom post type that is normally not visible to them otherwise in the backend of wordpress. Note: Id still like for them to be able to upload and edit their "own" media files just to be clear.


title: How to Change BuddyPress Mystery Man Graphic without Overwriting Core Image File

text: I am using Sarah Gooding's workaround to replace the core mystery man graphic with a custom graphic. It does not work. It continues to render the core mystery man graphic. Has anyone had any success overwriting the mystery man graphic?               // Source: http://wpmu.org/how-to-add-a-custom-default-avatar-for-buddypress-members-and-groups/          function myavatar_add_default_avatar( $url ) {              return get_stylesheet_directory_uri() .'/images/mystery-man.jpg';          }     add_filter( 'bp_core_mysteryman_src', 'myavatar_add_default_avatar' );      Tried this too (got it from http://etivite.com/api- hooks/buddypress/trigger/apply_filters/bp_core_mysteryman_src/). It did not work either:               apply_filters( 'bp_core_mysteryman_src', 'myavatar_add_default_avatar' );


title: Number of posts in the archive

text: How do I show 10 posts on the first page of the archive, and 20 on others (>1)? My custom post type name is "apartments". Cheers!


title: Blog page showing same content as homepage

text:
I'm trying to have my posts post on another page(blog) and my 'home' page display as my front page. Both pages have their own templates assigned to them (home for home, blog for blog). In the Reading settings, I've set front page as home, posts page as blog. But when I go to url.com/blog, it displays the same template as my home page. I'm not sure why it won't display my two blog posts. In my home.php template, I have the following code, could this be the issue?                    <?php          $args = array('post_type'=> 'page');         query_posts( $args );     ?>
         <?php              if ( have_posts() ) {                 while ( have_posts() ) {                     the_post();              ?>
                     <a href="<?php echo get_permalink(); ?>">

                                 <?php                                      echo(types_render_field("top-overlay", array("output"=>"html")));                                 ?>                                 <?php                                      echo(types_render_field("bottom-overlay", array("output"=>"html")));                                 ?>
                                   <?php the_post_thumbnail(); ?>

         <?php                 }              }          ?>


title: How would I bulk change posting date?

text: How would I bulk change posting date? I want to change about 20 post publish dates at a time in one click


title: How make top level menu item not have link, but have sub-menus that are linked?

text: I'm building a horizontal menu and some of the entries on that menu will have dropdowns (sub-menus), and some won't. Those that have sub-menus are not actually pages. They're just meant to be guides for the dropdowns. For instance, say the the horizontal menu is like follows: Home | About Us | Products | Directions | Contact And the "products" li item is meant to have 3 pages linked in a vertical dropdown list below it, so "products" itself doesn't actually represent a page, how can I do that in WP? (I use WP as a CMS, with static home and inside pages. I build my own templates, style the menus in CSS, then register the menus in the functions.php and call them in the templates.) In WP you add entries to the menus via the list of pages, or by the custom links. But I don't want "products" to be linked. If I don't add a link to the custom link it won't let me add it to the menu. Is this doable through the menus admin or do I have to approach it some other way? Thank you for any help!


title: Order users by custom user meta

text:
I'm showing a list of users like so:
          <?php   $directors = get_users('role=director');                   foreach ($directors as $director) {                       $dir_id = $director->ID;                      $dir_order = get_user_meta($dir_id, 'exit_director_order', TRUE);                      $dir_link = get_bloginfo('home').'/?author='.$dir_id;                       if ($dir_id == $director_id ) {                          $dir_class= 'current director-'.$dir_id;                      } else {                           $dir_class= 'director-'.$dir_id;                 }     ?>
                     <a href="<?php print $dir_link; ?>" class="<?php print $dir_class; ?>"><?php echo $director->display_name; ?>

               <?php } ?>
      I'd like to order the users by dir_order (in order of smallest number to largest). These values are stored in the database as integers. How might I go about doing this? * * * **EDIT:** Here's the solution. Comments included:               <?php   $results = get_users('role=director');                   foreach ($results as $result) {                      // Get data about each user as an object                 $user = get_userdata($result->ID);                            // Create a flat array with only the fields we need                 $directors[$user->ID] = array(                     'dir_order'     =>  $user->exit_director_order,                     'dir_id'        =>  $user->ID,                     'dir_name'      =>  $user->first_name.' '.$user->last_name                         );             }                  // Sort             sort($directors);                   // The list             echo '
';                  // For each result             foreach ($directors as $director) {                       // Set up the variables                 $dir_id = $director['dir_id'];                 $dir_order = $director['dir_order'];                 $dir_name = $director['dir_name'];                 $dir_link = get_bloginfo('home').'/?author='.$director['dir_id'];                            // The list items                 echo '
';                 echo ''.$dir_name.'';                 echo '
';                       }                   echo '
';               ?>


title: Replace function in a child theme

text: Is there a way to replace a function by another function in a child theme? In other words, in a theme there is a function named "theme_function" and this function is called by several files inside the theme.   I would like to find, if exist, an action that replace all occurrences of "theme_function" with another function "child_function" inside the child theme. Please note that "theme_function" that I want to replace do not have the following block:               if ( !function_exists('theme_function') ) :        because if it that case is easy to replace the theme_function with another function having the same name in functions.php


title: mod-rewrite rules grabs "broken permalinks", too

text: This is the automatically generated htaccess file of WP using permalinks for the pattern `/%year%/%postname%/` (working with `http://localhost/BLOG- FOLDER/` yet):               <IfModule mod_rewrite.c>     RewriteEngine On     RewriteBase /BLOG-FOLDER/     RewriteRule ^index\.php$ - [L]     RewriteCond %{REQUEST_FILENAME} !-f     RewriteCond %{REQUEST_FILENAME} !-d     RewriteRule . /BLOG-FOLDER/index.php [L]     </IfModule>      Now the problem is that the rewrite rule applies for `http://localhost/BLOG- FOLDER/this-file-does-not-exist`, too, and not only for "correct permalinks" such as `http://localhost/2012/My-first-entry/`. So, what are the modifications of my htaccess file to get this work? Thanks a lot! Carlos


title: How do I query a taxonomy term range

text: NOTE: The links will work If you copy & paste them. (I'm a newbie so I am not allowed to add to many links to the question) I have a few taxonomies that I would like to query a range from, for example   * price   * age   * vintage I found this question which helped me some How to pass URL parameters for advanced taxonomy queries with multiple terms for one custom taxonomy With the above examples I could query the age taxonomy as an example for the year of 10 and 20   * tax.jenswedin.com/age/10,20/   * tax.jenswedin.com/?age=10,20 This works ok. But if I would like to do an query for an an range of ages, for example form 10-20 I would need to   * tax.jenswedin.com/age/10,11,12,13,14,15,16,17,18,19,20/ And if I would like to do a range between 10-100 you can imagine it will will not look that good. So I tried to put the age terms in sub taxonomy terms so the structure would be like this   * 11-20      * 11     * 12     * 13     * 14     * 15     * 16     * 17     * 18     * 19   * 21-30      * ...     * ... By doing this I could now query like this   * tax.jenswedin.com/age/11-20/ And it would work, it would show all ages within 11-20 But this way is quite inflexible, I would need just range between 15-20 this wouldn't work. What I would like to know if there is a way that the range is dynamic and more flexible. I know that @scribu had a plugin (which isn't supported longer) that had the had support for ranges with the min & max for custom fields. But I haven't seen anything like this for taxonomies.   * chwisgi.com/?age-min=20&age-max=30 Any help would be appreciated.


title: What are the best practices for updating?

text: Don't want to do anything to take down my blog. Here are some upgrade-related questions:   1. How often should Wordpress be updated?   2. What is the best way to do it?   3. How to know if there is a problem with plugins? When a new version of Wordpress comes out, we have no way of knowing if there is a problem with existing plugins.   4. When should plugins be updated? At the same time as Wordpress?   5. Is there a test suite that is run before releasing Worddpress? Does it include plugins?


title: customize footer widgets area

text:
I have a custom footer widgets area which is displaying a maximum of 4 widgets horizontally in one row. If I add more than 4 widgets then the layout breaks because is trying to display it in the same row. I want to make it more flexible, for example to have 2 rows (divs) where I can add on the first one let's 2 widgets, and in the second one 4 widgets. Probably what I need is to duplicate this one and make two footer areas. Is this possible and if it is how can I achieve this? Here is the actual code of my widgets.php :                   /* Footer Widgets */     $footer_widgets_num = wp_get_sidebars_widgets();     $footer_widgets_num = (isset($footer_widgets_num['footer-widgets'])) ? count( $footer_widgets_num['footer-widgets']) : 0;          switch ($footer_widgets_num) {         case 1:             $footer_widgets_num = '12';         break;         case 2:             $footer_widgets_num = '6';         break;         case 3:             $footer_widgets_num = '4';         break;         case 4:             $footer_widgets_num = '3';         break;         case 5:             $footer_widgets_num = '2 offset1';         break;         case 6:             $footer_widgets_num = '2';         break;         case 7:             $footer_widgets_num = '1';         break;         case 8:             $footer_widgets_num = '1 offset2';         break;         case 11:             $footer_widgets_num = '1';         break;         case 12:             $footer_widgets_num = '1';         break;         default:             $footer_widgets_num = '1';         break;     }          register_sidebar(array(        'name' => __('Footer Widgets','outbox' ),        'id'   => 'footer-widgets',         'description'   => __( 'There are 4 slots available in the footer','outbox' ),         'before_widget' => '
',         'after_widget'  => '
',         'before_title'  => '
',         'after_title'   => '
'     ));       }


title: Create post for every user?

text: I was wondering is there a way to create a post for every user. Sort of like a mass update that would associate certain user meta to the post created. I would prefer running a loop script that goes through all users and creates a post for each using certain user meta info. For instance, if I have five users that I would like to create posts for. The posts would be titled using each of their full names. Basic Example: **Users** johnny jannie bobbie craig mitch **User Meta** John Doe Jane Doe Bob Collins Craig Matthews Mitchell Humphries **Post Titles:** John Doe Jane Doe Bob Collins Craig Matthews Mitchell Humphries This request is uncommon but I need a temporary fix until I finish a plugin for full user search. Any help with this would be greatly appreciated.


title: how to remove indent from twently eleven comments reply

text: how i can remove indent from comments reply if someone reply comments it indent to previous reply and keep adding indent..how i can make it just indent first reply and other show under this.. i searched for solution on google and stackexchange but could't find any..its output simple ordered list for comments and reply to comments with different classes added to list HTML OF COMMENTS


title: how to transfer the post content from index / category/Archive page to another page with a form?

text:
I have a wordpress site ! I want to insert a link below each article/post on the index/category/archive page which on click , i want to open a page which has a FORM with title and a message text area ! And at the same time i want to auto fill the text area with the post/article content to the message text area ! I tried to insert the code below just aftter on index/category.php but couldn't transfer/auto fill the content to the message textarea. How i can i achieved this ... my php and java script knowledge is very limited.
          <a href="#" onclick="open_win( '<?php the_permalink(); ?>' ; open_link( '<?php get_the_content(); ?>' ))">More...


title: How to style this wp_list_pages markup

text:
I'm wanting to custom style the output of this wp_list_pages $children echo, here is the code:               <?php     if($post->post_parent)       $children = wp_list_pages("title_li=&child_of=".$post->post_parent."&echo=0");     else       $children = wp_list_pages("title_li=&child_of=".$post->ID."&echo=0");     if ($children) { ?>
       <?php echo $children; ?>
     <?php } ?>      As you can see I've already added a class to the UL, but what if I want to dig a little deeper and add some markup around the $children in the echo? Any help is greatly appreciated. Thank you! I would like to achieve something like the following:

Link

Link

Link

Link

Link

      I've temporarily appended the __makrup through jQuery, but I would like to know for future reference ideally.


title: Deploying Wordpress for clients - what do they have access to?

text: I've developed websites from scratch up till now and would like to switch to using Wordpress to save time and money. I've done some theme customization and plugin work so far. I can see that users can update posts and customize themes themselves from `/wp-admin`. What I'm concerned about it - is that how projects are generally deployed in wordpress? That the client has access to customize pretty much everything themselves? Do they really get to see all this? ![enter image description here](http://i.stack.imgur.com/yw7U7.png) I've generally made custom CMSs for clients based on whatever their website was, but somehow I feel like this is a bit much for clients to have access to? Or is it normal?


title: Disable post thumbnails in Twenty Thirteen child theme

text: I've made a theme that's a child of the standard Twenty Thirteen theme. Twenty Thirteen displays `post_thumbnail` images at the top of each of my pages, and I'd like my theme to not do this. I could create my own version of all the templates that use it (like `page.php`, `content.php`) but this seems overkill for making such a small change. I tried doing `remove_theme_suport('post-thumbnail')` but that had no effect. I tried just deleting the `add_theme_support('post-thumbnail')` line from Twenty Thirteen's `functions.php`, but that had no effect. I could hide the thumbnail using CSS, but the image is still loaded, and I'd prefer the HTML to not be included at all. I don't want to go through loads of existing posts/pages and remove all the thumbnails I set ages ago. Any thoughts? Is it possible to override `has_post_thumbnail()` so that it always returns `FALSE`? NOTE: This is not the same as the "header" images Twenty Thirteen puts in the site-header block, but appears below the main navigation, in the main content of the page.


title: How to add author details in the post sidebar?

text: I would like to add author details in the sidebar instead of bottom of the post? Can anyone tell me how to do that? As of now i'm using like this in the loop               <?php $curauthor = get_the_author_meta('ID');  echo get_avatar($curauthor, $size = '128'); ?>          <?php the_author_posts_link(); ?>      Can anyone tell me how to do this outside loop? Thanks


title: key( $GLOBALS['wp_registered_sidebars'] ) is always showing the same value

text:
I am using this code from another answer               add_action( 'dynamic_sidebar', 'wpse_96681_hr' );          function wpse_96681_hr( $widget ) {              static $counter = 0;              // right sidebar in Twenty Ten. Adjust to your needs.         if ( 'sidebar' === key( $GLOBALS['wp_registered_sidebars'] ) )              print '
THIS IS SIDEBAR 1
';              if ( 0 !== $counter && 0 === $counter % 1 )             print '

test
';              $counter += 1;     }      The problem is that it can't detect the sidebar correctly `key( $GLOBALS['wp_registered_sidebars'] )` always outputs `footer-1` that is the last widget area my theme (genesis framework) registers. But it should actually output `sidebar` (inside that primary sidebar at least) because that is where I am seeing the test output when I remove the 2 lines. I could use the `before-` and `after-widget-area` hooks to add the action there and remove it later but I would prefer a non framework specific version of this code that works everywhere. Any Ideas? Is this code just not working under genesis (my guess) or outdated? Maybe another solution to detect on what widget area the loop is currently on? // edit: Strange thing (not really) is that this is executed on admin, I see the code there, no problem I can deal with that later, and actually use it to test it and changed the check to === and now its positive on the primary and secondary sidebar for whatever reason. I not get it. ![admin widgets](http://i.stack.imgur.com/bRXrt.png) On the frontend however "this is sidebar 1" is not displayed at all. Hate shit like this.


title: Using a conditional tag for the home page banner

text:
I'm setting up my wordpress website on my server now and have the rotating images on the home page and it's beautiful, but now I want to have a conditional tag telling wordpress if it's not the home page use the featured images per each page. This is the code I've placed onto my home page to display my plugin rotating banners from iThemes.com               <?php if (function_exists('dynamic_sidebar') && dynamic_sidebar('banner-widget')) : else : ?>
<img class="banner" src="<?php bloginfo('template_directory') ?>/img/BANNER1-averylawoffice.jpg" alt="Banner 1">
     <?php endif; ?>      It works great! My widget is ready to go for this, images are all there and it works. Now I have this code I want to put into an if else statement so if the page ISN'T the home page, show the featured image. I'm no programmer expert and have looked around a lot to get this code, however it doesn't work and I just see a blank spot on the home page and the images on the rest of the page as they should be.               <?php if (is_home()) {         <?php if (function_exists('dynamic_sidebar') && dynamic_sidebar('banner-widget')) : else : ?>
<img class="banner" src="<?php bloginfo('template_directory') ?>/img/banner.jpg" alt="Banner 1">
         <?php endif; ?>     } else { ?>
<?php the_post_thumbnail( 863, 328 );?>
     <?php } ?>      What am I doing wrong is order to not get the desired effect I'm looking for? I know this is simple so I don't want to use a useless plugin to do this and slow down the site as it's going to be slow as is. Any help or suggestions would be great!


title: Change upload directory for PDF files

text: I would like to change the upload directory for PDF files **only** , not for other files. For example, the PDF files would be uploaded to `wp- content/uploads/pdf` but other files would remain in `wp- content/uploads/yyyy/mm`. I know it possible to filter `upload_dir` but I don't know how to do it with file types/mimes. Thanks!


title: Trying to set specific image dimensions and crop with ACF

text: **My question is about image sizing**. I get how to the sizing/cropping stuff natively in WP               add_image_size( 'thumb-crazy', 500,500, true);      And then in the template type:               if ( has_post_thumbnail() ) {     the_post_thumbnail('thumb-crazy'); //This images get dimensions 500x500.     }       _But I'm struggling how to set which image-sizes to use for ACF-plugin:_ When I put this in functions.php               add_image_size( 'thumb-crazy', 500,500, true);      I select `thumb-crazy` from the attributes of the image-field. (It doesn't to do any crop at all or some totally other dimensions)               $image = get_field('image_personnel');     $size = 'thumb-crazy';     echo wp_get_attachment_image( $image, $size );      It doesn't have the effect that the image is 500x500 cropped. Why? **Is this an issue with the plugin** or am I missing something?


title: $item->url not retrieving url in custom walker?

text:
I've made a custom walker to use with wp_list_pages to modify the output to have thumbnails show. The goal is to have a list show up in a page template, which lists all children with their children. The walker I have below seems to work for getting the thumbnail and page title but doesn't get the url of the page. Do I need to somehow use a `get`prefixed function instead of just `esc_attr`?                           class bio_walker extends Walker_Nav_Menu                 {                      function start_el(&$output, $item, $depth, $args)                 {                           $output .= "
ID' class='bio-list'>";                      $attributes  = "class='highlight-$item->ID'";                      ! empty( $item->attr_title )                     and $attributes .= ' title="'  . esc_attr( $item->attr_title ) .'"';                 ! empty( $item->target )                     and $attributes .= ' target="' . esc_attr( $item->target     ) .'"';                 ! empty( $item->xfn )                     and $attributes .= ' rel="'    . esc_attr( $item->xfn        ) .'"';                 ! empty( $item->url )                     and $attributes .= ' href="'   . esc_attr( $item->url        ) .'"';                           $pageid = get_post_meta ( $item->ID, '_menu_item_object_id', true);                 $thumbnail = get_the_post_thumbnail( $item->ID, 'bio-thumb', true);                           $title = get_the_title($item->ID);                      $spanclass = "class='span-$item->ID bio-list-span'";                      $item_output = $args->before                     . ""                     . $thumbnail                     . ""                     . $title                     . $pageid                     . ""                     . ' ';                      $output .= apply_filters(                     'walker_nav_menu_start_el'                 ,   $item_output                 ,   $item                 ,   $depth                 ,   $args                 );                 }                 }


title: styles/default.css in markup, where does it come from?

text: I have the following line under the `head` tag but I don't have the file `styles/default.css` in my theme and consequently get a loading error in browsers. I'd like to eliminate this line but I don't know where it comes from. I tried to disable all plugins but it still appears. Is this a standard inclusion in WP? `<link type="text/css" rel="stylesheet" href="http://wp.dev/wordpress/wp- content/themes/theme1/styles/default.css">`