title: Media library orphans

text: I have this conditional statement that checks if an image has been added to a custom post type and if it hasn't it inserts a default image.               if ( get_post_meta( get_the_ID(), 'team_page_custom_image', true ) ) {          echo wp_get_attachment_image($post_meta_data['team_page_custom_image'][0], 'medium');           }           else {             echo '<img src="' . get_bloginfo( 'stylesheet_directory' ) . '/img/team-logo.png" />';         }      It seems works fine except when an image is chosen and then deleted from the media library it leaves a blank spot as there is still a meta value in the database for the post-meta. I know I can just delete them from the database but is there a function somewhere to take care of orphans from media library deletions?


title: Showing posts from different categories and from custom post type

text: On my main page, I want to show posts from 3 categories, and 1 custom post type. Is there a way to get them together in one `pre_get_posts` function? Or do I need to query separately - once for the CPT and once for the posts from specific categories?


title: can't access backend while frontend works perfect

text: Before 2 days there was a automatic update for wordpress, which I for my website. When the update was over, I tried to access backend but I always get this message:               Fatal error: Call to undefined function wp_is_mobile() in /home/*******/public_html/wp-login.php on line 67      Can you give me any idea what to do, how to fix this. Thanks


title: Name of last category level for a post

text: I want to show the last category level of a post for example, I hav a post in category "Course -> resultat -> Trail" I want to show just "trail" Thanks if somenone can help


title: add_theme_support( 'post-thumbnails', array( 'post')); is not uploading the file

text: So I used the codes below in the functions.php               add_theme_support( 'post-thumbnails', array( 'post'));     set_post_thumbnail_size(100, 75);      And then in THE LOOP I called:               <?php the_post_thumbnail(); ?>      The image has an entry in the database with its url but the file isn't uploaded when I checked in the wp-content/uploads/ directory. What am I doing wrong?


title: Filter everything from content except output of a shortcode

text: Is it possible to filter the output of either the content or excerpt so that I only get the the shortcode output and so that if a user enters more than the shortcode the rest of the content for that page would be stripped.


title: WP Paginate not working properly

text:
Im creating a WP for a custom type post in a page template:                   <?                          global $paged;                     global $notquery;                     $temp = $notquery;                      $notquery = null;                                $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;                           $args = array(                         'post_type' => 'noticias',                         'paged' => $paged,                         'posts_per_page' => 1                          );                          $notquery = new WP_Query($args);                           while ( $notquery->have_posts() ) :                         $notquery->the_post();                         global $post;                         ?>      And it just dont works properly. I can access page 2 with /page/2/. So, paged seems to work. It prints out the wp-paginate navigation div, but nothing inside it.

      Whats the problem guys? thanks!


title: current_time('timestamp') seems to be different from the real current time

text: Does current_time('timestamp') have an issue? I am trying to get the current_time('timestamp'), and instead of giving me my **current time** :               Jun 26 2013 14:30      It gives me:               Jun 26 2013 21:30      I tried to check the seconds, and it gives me:               1372282238      Which is correct for the time given, but not for the **real current time**. What's happening?


title: Google PageSpeed: Avoid landing page redirects?

text: I am getting the following notice from Google PageSpeed:               Avoid landing page redirects          To speed up page load times for visitors of your site, remove as many landing page redirections as possible, and make any required redirections cacheable if possible.          http://site.com/blog is a non-cacheable redirect to http://site.com/blog/      The trailing slash is not present in my html files so I'm not sure why `blog` redirects to `blog/`. The actual page is here. How do I correct this?


title: Unescape attribute the_title() on CDATA in RSS feed

text: My goal is to **unescape the string**. So, how would I do it in Wordpress? Let's say I have the whole string below:               He said, “This is how it works...”      I can't seem to find a built-in Wordpress function to unescape `“` and `”`. This is if using unescape on `the_title()` (sorry for not specifying earlier). On the rss feed items, I have this code where `the_title()` should be unescaped:               <item>       <title><![CDATA[<?php the_title(); ?>]]></title>       <link><?php echo get_permalink(); ?></link>       <date><?php the_time(get_option('date_format')); ?></date>     </item>


title: Featured Images for Tags?

text: Is it possible to somehow create featured images for tags or custom taxonomies. For the sake of explanation, I will give an example of the possible functionality. Say I am running a website that posts the best restaurants by city. Some of my tags could be London, Paris NYC, etc... I have a page that grabs these tags and sorts them alphabetically. But rather than just have text, it would have the tag name (London for example) and an image for that city. I know this could be done manually, but by attaching an image to the tag or custom taxonomy, it could make the process a bit easier, especially if dealing with a great number of tags/custom taxonomies. I reckon this might be a bit more of an abstract question, but I am curious if anyone has come across any blogs or websites that are doing this successfully.


title: Upload file to remote storage

text: I am looking to overwrite the existing upload functionality to save the file on a remote storage service. The remote storage has an HTTP interface that allow me to post file and return an addressable URL back. The reason for doing this is that the remote storage service has large amount of space and is automatically replicated for high-availability. I have already figured out how to send files across. However, I am not sure which hook/function I should use to overwrite the existing behavior.


title: Broken CSS after changing the site URL

text: I have a self-hosted Wordpress blog on my home server. Previously I accessed it directly via its original IP address taken from DHCP, but now I have configured a static IP address for it. The problem is that now all the CSS is broken. I have updated my `wp-config.php` file adding the following two lines:               define('WP_HOME','http://192.168.0.100/myblog/');     define('WP_SITEURL','http://192.168.0.100/myblog/');      and I have restarted apache, but the CSS is still broken. Is there some other configuration file that I should update?


title: At MultiSite Network Update "Can't Resolve host", override and continue updating

text: When the WordPress Network Update script runs, if it gets to a site it "cannot resolve", the script stops there, and no sites are updated period. So if there is 1 site in a 1000 site MultiSite install that won't resolve (ie: domain expired) you cannot roll-out the update to any sites in your Network. You can of course go into Network admin and remove the site, but sometimes you don't have time, or you know the domain will be renewed (especially if it's your own domain). I was once pointed to a work-around for this. But alas, no amount of Google searching has helped me find it again. Does anyone know how to achieve this?


title: Image X or Image Y Based on Meta-Box Input Value

text: I have a meta box for a film review test site I'm trying to build. I have 3 fields in my meta box, they are `$director`, `$starring` and `$rating`. I want to take the rating, and put it into a page template, showing an image based on the numerical value entered into the `$rating` field. So, if `$rating = 5` I want to show an image of 5 stars, if it's 4, 4 stars etc. I'm guessing I need a PHP if for this, but I'm not exactly sure how the code would look for this? Any suggestions would be gratefully received. My save code for the meta boxes is as follows;                function save_moviereview_meta($post_id, $post) {         // verify this came from the our screen and with proper authorization,         // because save_post can be triggered at other times         if ( !wp_verify_nonce( $_POST['moviereview_noncename'], plugin_basename(__FILE__) )) {         return $post->ID;         }         // Is the user allowed to edit the post or page?         if ( !current_user_can( 'edit_post', $post->ID ))             return $post->ID;         // OK, we're authenticated: we need to find and save the data         // We'll put it into an array to make it easier to loop though.         $moviereview_meta['_director'] = $_POST['_director'];         $moviereview_meta['_starring'] = $_POST['_starring'];         $moviereview_meta['_rating'] = $_POST['_rating'];         // Add values of $moviereview_meta as custom fields         foreach ($moviereview_meta as $key => $value) { // Cycle through the $moviereview_meta array!             if( $post->post_type == 'revision' ) return; // Don't store custom data twice             $value = implode(',', (array)$value); // If $value is an array, make it a CSV (unlikely)             if(get_post_meta($post->ID, $key, FALSE)) { // If the custom field already has a value                 update_post_meta($post->ID, $key, $value);             } else { // If the custom field doesn't have a value                 add_post_meta($post->ID, $key, $value);             }             if(!$value) delete_post_meta($post->ID, $key); // Delete if blank         }     }     add_action('save_post', 'save_moviereview_meta', 1, 2); // save the custom fields


title: Trailing slash at the end of permalink loads faster / better SEO?

text: Is it true that if you put a trailing slash at the end of the permalink, it would load faster for a single or a multisite WordPress post? Also, is this better for SEO?


title: Related posts and custom meta_box?

text:
I am trying to code the ability to pick which posts should be included as related to the current post the user is editing. I have used @MikeSchinkel very helpfull post here, to include a list of posts in a metafield, I have then used this patch to make the option multi select-able, I have also used the jquery chosen plugin to tidy the list up slightly. I am now thoroughly stuck on how to retrieve the values in my loop on the front end, i've tried the following amongst other things:               $intro = get_post_meta( $post->ID, 'SELECT_POST_TYPE', true );     echo $intro;     var_dump( $_POST)      and this:               $intro = get_post_meta( $post->ID, $selected_post_id, true );     echo $intro;     var_dump($intro)      and this:               $intro = get_post_meta( $post->ID, 'select_box', true );     echo $intro;     var_dump($intro)      the code to register the meta_box is the following:               class WPSE_85107 {       var $FOR_POST_TYPE = 'question';       var $SELECT_POST_TYPE = 'post';       var $SELECT_POST_LABEL = 'Post';       var $box_id;       var $box_label;       var $field_id;       var $field_label;       var $field_name;       var $meta_key;       function __construct() {         add_action( 'admin_init', array( $this, 'admin_init' ) );       }       function admin_init() {         add_action( 'add_meta_boxes', array( $this, 'add_meta_boxes' ) );         add_action( 'save_post', array( $this, 'save_post' ), 10, 2 );         $this->meta_key     = "_selected_{$this->SELECT_POST_TYPE}";         $this->box_id       = "select-{$this->SELECT_POST_TYPE}-metabox";         $this->field_id     = "selected-{$this->SELECT_POST_TYPE}";         $this->field_name   = "selected_{$this->SELECT_POST_TYPE}";         $this->box_label    = __( "Select {$this->SELECT_POST_LABEL}", 'wpse-85107' );         $this->field_label  = __( "Choose {$this->SELECT_POST_LABEL}", 'wpse-85107' );       }       function add_meta_boxes() {         add_meta_box(           $this->box_id,           $this->box_label,           array( $this, 'select_box' ),           $this->FOR_POST_TYPE,           'side'         );       }       function select_box( $post ) {         $selected_post_id = get_post_meta( $post->ID, $this->meta_key, true );         global $wp_post_types;         $save_hierarchical = $wp_post_types[$this->SELECT_POST_TYPE]->hierarchical;         $wp_post_types[$this->SELECT_POST_TYPE]->hierarchical = true;         wp_dropdown_pages( array(           'id' => $this->field_id,           'name' => $this->field_name,           'selected' => empty( $selected_post_id ) ? 0 : $selected_post_id,           'post_type' => $this->SELECT_POST_TYPE,           'show_option_none' => $this->field_label,           'multiselect' => true,           'class' => 'chzn-select'         ));         $wp_post_types[$this->SELECT_POST_TYPE]->hierarchical = $save_hierarchical;       }       function save_post( $post_id, $post ) {         if ( $post->post_type == $this->FOR_POST_TYPE && isset( $_POST[$this->field_name] ) ) {           update_post_meta( $post_id, $this->meta_key, $_POST[$this->field_name] );         }       }     }     new WPSE_85107();      UPDATE: thanks to @matt_ here is the anwser this code goes in your front end loop-template:                $meta = get_post_meta($post->ID, '_selected_post', true);                                   if ( ! $meta ):                                 echo  '';                                      else:?>                             <a class="related_post" href="<?php echo get_permalink($meta); ?>"><?php echo get_the_title($meta); ?>
                         <?php  endif;


title: Rewrite Rule for Multilingual Website, Like qTranslate?

text: I would like to write my own little plugin for language switching. For that, the very first thing would be to get the rewrite rules running. I have been looking around the web for 2 hours, but I couldn't find an answer to my question yet. I would like to have it like this: `http://www.mysite.com/de/post-title/` or `http://www.mysite.com/de/projects/project-title/` So basically, what I'm trying to do is to keep the current url and all it's parameters, just add the currently active language snippet between the site url and the path. Here is my code so far:               function rewrite_rule_de(){         add_rewrite_tag('%lang%','([^&]+)');         add_rewrite_rule('^de/(.+?)/?$', 'index.php?p=$matches[1]&lang=de', 'bottom');         global $wp_rewrite;         $wp_rewrite->flush_rules();     }     add_action('init', 'rewrite_rule_de');


title: edit role display name and label name without plugins

text: I'am creating WordPress function for editing role name               function change_role_name($role_name, $new_role_name, $display_name) {         global $wp_roles;              if ( ! isset( $wp_roles ) )             $wp_roles = new WP_Roles();              $role =& get_role($role_name);              $wp_roles->roles[$role]['name'] = $new_role_name; //not working for sa         $wp_roles->role_names[$role] = $display_name;                }      problem here it don't change the role label name


title: Proper use of the_content filtering

text: This is a bit difficult without posting scads of code, but my question is: What are the benefits of filtering through `apply_filters('the_content', 'anything');`, and given my example loop, am I filtering `the_content` excessively or inefficiently, or is there a better way? I ask because I just tried the Shareaholic plugin, which is supposed to detect the end of the post and insert social links. In my loop however, I find that it injects itself each time `apply_filters('the_content', 'anything');` is called, which in my case is quite a lot. Because I'm new to WP and PHP, and Shareaholic is an established service, I just assume these problems are due to ignorance on my part. Shareaholic has a shortcode that I can implement directly into the template, but I just want some general feedback / validation / criticism on my approach, and any ideas how to clean up or what may be causing the issue. My loop looks something like this:                   <?php /* Start loop */ ?>         <?php while (have_posts()) : the_post(); ?>              <?php function_for_post_banner() /* filters 'the_content' to add a post banner */ ?>              <?php get_template_part('templates/loop', 'switch');         /* Switch tests for post type and applies conditional markup, handels post type media and calls 'the_content' specific to each case. */ ?>              <? fuction_attachements();         /* do conditional formatting with post attachments ie images, media & docs all filtered through the_content  */ ?>         <?php /* End Loop */ ?>      Any advice on this is much appreciated -- thanks.


title: Wp Dropdown Category Not Show Current As Title

text: Im using wp_dropdown_categories for a page. Issue im having is i dont want it to show the current category that the page is on as the title, i want it always to display the "Select A Category" text i have placed in the options. Current code is:               wp_dropdown_categories( 'show_option_none=Select A Category&show_count=1');      Is there a way to do this?


title: How to get Viewing profile ID in buddypress?

text: I want to get the viewing profle's (another user's profile that current user is viewing) user_id is there any shortcode or function available for it? Thanks in advance.


title: Images inside post title

text: Is there a way to insert images into a post title? It would also need to display the alt text in the `<title>` tag, permalinks, etc. The reason I need to do this is I have a client who want their logo used in page titles instead of plain text. Therefore, the image could be anywhere in the title, so I can't just append/prepend the image. The only solution I can think of would be to do a find and replace using javascript, but this doesn't seem like a great solution...


title: Gallery Short Code

text: I am wondering what would make the gallery short code not work and just display in posts as: `[gallery]` I am creating a custom theme, I have no plugins installed and the short codes I have made do not touch, reference or manipulate the gallery short code inn any way. All short codes accept gallery seem to work. Any tips for debugging?


title: Twenty Twelve Theme: Edge to edge background

text: I was looking at various websites. I really liked the edge to edge look: see woothemes.com (the blue background). I did a little research and learned about classes, id's, and the rest. I tried to implement it in the Wordpress Twenty Twelve theme. I had trouble but finally "figured it out". Can you tell me if this is the "right way" to do this? My CSS:               /* Home page styles (classes and id's) */     #welcome-home {     background-color: #000000;     color: #FFFFFF;     margin-left: -5000px;     margin-right: -250px;     padding-top: 20px;     padding-left: 5000px;     padding-right: 315px;     position: absolute;     }      Also, the responsiveness messes with the look. Other sites like this are not responsive. Can you tell me how to fix this (remove responsiveness) in Twenty Twelve. Thank you all in advance for your support!


title: How do you split multiple-column loop on category archive page?

text: I am creating a custom page template with multiple loop like this http://demos.gabfirethemes.com/advanced/category/football/ You can see there are posts split up into multiple columns: One featured post, then 2 posts, and then 4 posts on right side. I could only get posts into 2 column. Can you please explain how to split loop in multiple columns like this ?


title: How to fix Warning: call_user_func_array()?

text:
I modified my theme metabox.php to fit my needs, and I got this eror > Blockquote Warning: call_user_func_array() expects parameter 1 to be a valid > callback, function 'mytheme_add_box' not found or invalid function name in > E:\xampp\htdocs\wordpress\wp-includes\plugin.php on line 406 Blockquote How can i fix it ? This is my old metabox code               <?php     $prefix = 'wtf_';          $meta_box = array(         'id' => 'propertybox',         'title' => 'Property listing details',         'page' => 'listings',         'context' => 'normal',         'priority' => 'high',         'fields' => array(                 array(                 'name' => 'Propert ID number',                 'desc' => 'Enter a property ID number, if any ',                 'id' => $prefix . 'pid',                 'type' => 'text',                 'std' => ''             ),                       array(                 'name' => 'Bath',                 'desc' => 'Number of bathrooms.',                 'id' => $prefix . 'bath',                 'type' => 'text',                 'std' => ''             ),                  array(                 'name' => 'An',                 'desc' => 'Anul constructiei',                 'id' => $prefix . 'an',                 'type' => 'text',                 'std' => ''             ),                        array(                 'name' => 'Etaj',                 'desc' => 'Etajul',                 'id' => $prefix . 'etaj',                 'type' => 'text',                 'std' => ''             ),                        array(                 'name' => 'Balcone',                 'desc' => 'Numar balcoane',                 'id' => $prefix . 'balcon',                 'type' => 'text',                 'std' => ''             ),                        array(                 'name' => 'Parcare',                 'desc' => 'Numar locuri de parcare',                 'id' => $prefix . 'parcare',                 'type' => 'text',                 'std' => ''             ),                        array(                 'name' => 'Suprafata totala',                 'desc' => 'Suprafata totala a terenului (Casa/vila)',                 'id' => $prefix . 'suprafatatotala',                 'type' => 'text',                 'std' => ''             ),                        array(                 'name' => 'Front stradal',                 'desc' => 'Suprafata front stradal',                 'id' => $prefix . 'front',                 'type' => 'text',                 'std' => ''             ),                        array(                 'name' => 'Suprafata curte libera ',                 'desc' => 'Suprafata curte libera ',                 'id' => $prefix . 'suprafatacurte',                 'type' => 'text',                 'std' => ''             ),                        array(                 'name' => 'Amprenta casei ',                 'desc' => 'Suprafata amprentei  ',                 'id' => $prefix . 'amprenta',                 'type' => 'text',                 'std' => ''             ),                        array(                 'name' => 'Regim inaltime',                 'desc' => 'Regim inaltime  ',                 'id' => $prefix . 'inaltime',                 'type' => 'text',                 'std' => ''             ),                        array(                 'name' => 'Certificat urbanism ',                 'desc' => 'certificat urbanism',                 'id' => $prefix . 'certificat',                 'type' => 'text',                 'std' => ''             ),                        array(                 'name' => 'Asking price',                 'desc' => 'Enter the actual asking price ',                 'id' => $prefix . 'price',                 'type' => 'text',                 'std' => ''             )                   ),          );               add_action('admin_menu', 'mytheme_add_box');          // Add meta box     function mytheme_add_box() {         global $meta_box;              add_meta_box($meta_box['id'], $meta_box['title'], 'mytheme_show_box', $meta_box['page'], $meta_box['context'], $meta_box['priority']);     }          // Callback function to show fields in meta box     function mytheme_show_box() {         global $meta_box, $post;              // Use nonce for verification         echo '<input type="hidden" name="mytheme_meta_box_nonce" value="', wp_create_nonce(basename(__FILE__)), '" />';              echo '
';              foreach ($meta_box['fields'] as $field) {             // get current post meta data             $meta = get_post_meta($post->ID, $field['id'], true);                  echo '
',                     '', $field['name'], '	',                     '';             switch ($field['type']) {                 case 'text':                     echo '<input type="text" name="', $field['id'], '" id="', $field['id'], '" value="', $meta ? $meta : $field['std'], '" size="30" style="width:97%" />',                         '
', $field['desc'];                     break;                 case 'textarea':                     echo '<textarea class="theEditor" name="', $field['id'], '" id="', $field['id'], '" cols="60" rows="4" style="width:97%">', $meta ? $meta : $field['std'], '</textarea>',                         '
', $field['desc'];                          break;                 case 'select':                     echo '<select name="', $field['id'], '" id="', $field['id'], '">';                     foreach ($field['options'] as $option) {                         echo '<option', $meta == $option ? ' selected="selected"' : '', '>', $option, '</option>';                     }                     echo '</select>',                     '
', $field['desc'];                     break;                 case 'radio':                     foreach ($field['options'] as $option) {                         echo '<input type="radio" name="', $field['id'], '" value="', $option['value'], '"', $meta == $option['value'] ? ' checked="checked"' : '', ' />', $option['name'];                     }                     break;                 case 'checkbox':                     echo '<input type="checkbox" name="', $field['id'], '" id="', $field['id'], '"', $meta ? ' checked="checked"' : '', ' />';                     break;             }             echo    '',                 '
';         }              echo '
';     }          add_action('save_post', 'mytheme_save_data');          // Save data from meta box     function mytheme_save_data($post_id) {         global $meta_box;              // verify nonce         if (!wp_verify_nonce($_POST['mytheme_meta_box_nonce'], basename(__FILE__))) {             return $post_id;         }              // check autosave         if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {             return $post_id;         }              // check permissions         if ('page' == $_POST['post_type']) {             if (!current_user_can('edit_page', $post_id)) {                 return $post_id;             }         } elseif (!current_user_can('edit_post', $post_id)) {             return $post_id;         }              foreach ($meta_box['fields'] as $field) {             $old = get_post_meta($post_id, $field['id'], true);             $new = $_POST[$field['id']];                  if ($new && $new != $old) {                 update_post_meta($post_id, $field['id'], $new);             } elseif ('' == $new && $old) {                 delete_post_meta($post_id, $field['id'], $old);             }         }     }          ?>      And this is my new code               <?php     $prefix = 'wtf_';          $property_fields = array(              array(                 'name' => 'Propert ID number',                 'desc' => 'Enter a property ID number, if any ',                 'id'   =>   $prefix.'pid',                 'type' => 'text',                 'std'   => ''              ),              array(                 'name' => 'Bath',                 'desc' => 'Number of bathrooms.',                 'id'   => $prefix.'bath',                 'type' => 'text',                 'std'  => ''              ),                    array(                  'name' => 'An',                  'desc' => 'Anul constructiei',                  'id'   => $prefix.'an',                  'type' => 'text',                  'std'  => ''              ));          $mansion_fields = array(                  array(             'name' => 'Etaj',             'desc' => 'Etajul',             'id' => $prefix . 'etaj',             'type' => 'text',             'std' => ''         ),                    array(             'name' => 'Balcone',             'desc' => 'Numar balcoane',             'id' => $prefix . 'balcon',             'type' => 'text',             'std' => ''         ),                    array(             'name' => 'Parcare',             'desc' => 'Numar locuri de parcare',             'id' => $prefix . 'parcare',             'type' => 'text',             'std' => ''         ),                    array(             'name' => 'Suprafata totala',             'desc' => 'Suprafata totala a terenului (Casa/vila)',             'id' => $prefix . 'suprafatatotala',             'type' => 'text',             'std' => ''         ),                    array(             'name' => 'Front stradal',             'desc' => 'Suprafata front stradal',             'id' => $prefix . 'front',             'type' => 'text',             'std' => ''         ),                    array(             'name' => 'Suprafata curte libera ',             'desc' => 'Suprafata curte libera ',             'id' => $prefix . 'suprafatacurte',             'type' => 'text',             'std' => ''         ),                    array(             'name' => 'Amprenta casei ',             'desc' => 'Suprafata amprentei  ',             'id' => $prefix . 'amprenta',             'type' => 'text',             'std' => ''         ),                      array(             'name' => 'Regim inaltime',             'desc' => 'Regim inaltime  ',             'id' => $prefix . 'inaltime',             'type' => 'text',             'std' => ''         ),                    array(             'name' => 'Certificat urbanism ',             'desc' => 'certificat urbanism',             'id' => $prefix . 'certificat',             'type' => 'text',             'std' => ''         ),                    array(             'name' => 'Asking price',             'desc' => 'Enter the actual asking price ',             'id' => $prefix . 'price',             'type' => 'text',             'std' => ''         ));          add_action( 'add_meta_boxes', 'my_meta_boxes' );     function my_meta_boxes(){         //Don't forget to change "post" with post_type where you want to add the metaboxes         add_meta_box("propertybox", "Property Options", "propertybox", "listings", "normal", "high");         add_meta_box("mansionbox", "Mansion Options", "mansionbox", "listings", "normal", "high");      }          function propertybox(){         global $prefix;         global $property_fields;        //Put here the fields you want display inside the "Property options" box.         build_fieds($property_fields);     }          function mansionbox(){         global $prefix;         global $mansion_fields;              build_fieds($mansion_fields);     }          function build_fieds($fields){          global $post;               echo '
';          foreach ($fields as $field) {         // get current post meta data         $meta = get_post_meta($post->ID, $field['id'], true);              echo '
',                 '', $field['name'], '	',             '';         switch ($field['type']) {             case 'text':                 echo '<input type="text" name="', $field['id'], '" id="', $field['id'], '" value="', $meta ? $meta : $field['std'], '" size="30" style="width:97%" />',                 '
', $field['desc'];                 break;             case 'textarea':                 echo '<textarea class="theEditor" name="', $field['id'], '" id="', $field['id'], '" cols="60" rows="4" style="width:97%">', $meta ? $meta : $field['std'], '</textarea>',                 '
', $field['desc'];                      break;             case 'select':                 echo '<select name="', $field['id'], '" id="', $field['id'], '">';                 foreach ($field['options'] as $option) {                     echo '<option', $meta == $option ? ' selected="selected"' : '', '>', $option, '</option>';             }                 echo '</select>',             '
', $field['desc'];                 break;             case 'radio':                 foreach ($field['options'] as $option) {                     echo '<input type="radio" name="', $field['id'], '" value="', $option['value'], '"', $meta == $option['value'] ? ' checked="checked"' : '', ' />', $option['name'];             }                 break;             case 'checkbox':                 echo '<input type="checkbox" name="', $field['id'], '" id="', $field['id'], '"', $meta ? ' checked="checked"' : '', ' />';                 break;         }         echo    '',             '
';     }           echo '
';     }          add_action('save_post', 'mytheme_save_data');          // Save data from meta box     function mytheme_save_data($post_id) {              global $mansion_fields;         global $property_fields;              // check autosave         if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {             return $post_id;         }              // check permissions         if ('page' == $_POST['post_type']) {             if (!current_user_can('edit_page', $post_id)) {                 return $post_id;             }         } elseif (!current_user_can('edit_post', $post_id)) {             return $post_id;         }              foreach ($property_fields as $field) {             $old = get_post_meta($post_id, $field['id'], true);             $new = $_POST[$field['id']];                  if ($new && $new != $old) {                 update_post_meta($post_id, $field['id'], $new);             } elseif ('' == $new && $old) {                 delete_post_meta($post_id, $field['id'], $old);             }          }              foreach ($mansion_fields as $field) {             $old = get_post_meta($post_id, $field['id'], true);             $new = $_POST[$field['id']];                 if ($new && $new != $old) {                update_post_meta($post_id, $field['id'], $new);            } elseif ('' == $new && $old) {                delete_post_meta($post_id, $field['id'], $old);            }          }     }     ?>


title: showing all recent posts in theme

text: I am creating a wp theme & I stuck at one point. I have recent post listing on my home page of theme which have `See All` link which redirect user to the page which list all the recent posts except news category. ![enter image description here](http://i.stack.imgur.com/zzv9J.png) So my question is what will be the link of `See All` on my home page ? can we create a new page at time of applying theme & link to it or there is any better option ? Any help will be appreciate.


title: Changing user_login ends current session

text: I have a site we wanted the login username to be the user's e-mail address. The user_login column contains the e-mail address. No problem. I created a custom function so that when the user updates their e-mail address on their profile page, the user_login column is also updated. Works like a charm. The problem is, when you change the user_login value, the WordPress session gets terminated. Assuming this is a cookie issue. Is there any way to stop the user from getting kicked out?


title: Wordpress plugin compatibility explaination when wordpress releases its new version (theoretical)

text: Recently i updated my `wordpress` to its latest `version 3.4.1` and noticed that few of my plugins are only compatible upto 3.3 although they are working correctly for my site even with the latest version. So does that means that i need to disable those plugins and look for the alternatives and these plugins are no more `SAFE` to use or it is something else( i downloaded all plugins from `wordpress.org` ONLY) . Need a better clarification over this and let me know if some concept i m missing with the up gradation :) . Detailed answer is really appreciated and i will do my part then :)


title: How to make sure that characters like < > dont appear in code snippets?

text: When I post some C++ code on my blog these markup characters `< >` appear in the html editor. It becomes a problem when I use a syntax highlighter and they appear in the post. How do I get rid of them?


title: Getting the dropdown menu to redirect to different pages?

text: What I am having trouble with is a dropdown box that I want to add to my sidebar. the blog will have more than one user so what I want for the dropdown to do is list all the different users by their display name and then once you click on one of the selected users to redirect you to that users bio page... the problem is that the only thing linking the users to their bio pages is the title of the page which will be their full name... so now I have to figure out a way to get the page id based on its title (since in the dropdown you will select the user by their full name which will equal the page title)... what I have been trying to do is tweak the wp_dropdown_users by adding stuff to the :               $output = "<select onChange='this.form.action=\"/wordpress/?page_id=\"                +this.options[this.selectedIndex].text ; this.form.submit()'                name='{$name}'{$id} class='$class'>\n";      now I am pretty sure I need a little php code to query the db or call a function instead of the this.options[this.selectedIndex].text, this code would, hopefully, return only the id of the page by its title... thus the url would be /wordpress/?page_id=(the id number returned)... this is the function I found for getting the page id by its title:                function get_page_by_title($page_title)      {         $page = get_page_by_title($page_title);         // $page is the post array. To just retrieve the id         $id = $page->ID;         return $id;      }      but I do not know the syntax well enough to implement it... would it be possible to call this function in this.form.action? is it even possible? any other way? any help would be appreciated and sorry if I didn't do something (research or explanation wise) p.s. I am doing my blog on my computer as the host so I cant really link to it since its not live sorry


title: Is there a way to filter the buddypress activity stream by date or time?

text: I've been trying to figure this out for weeks now and can't get it figured out. Ideally I like to filter the activity post by: today, week, month, and year. If anyone could please point me in the right direction, I'd greatly appriciate it. Thanks in advance.


title: Plugin: Custom menu item problem

text: I'm using the following snippet to add a menu item:               <?php     add_menu_page(         'Foo Server',         'Foo Server',         'manage_options',         'foo-server',         array('Class', 'method')     );     ?>      Fine, it's displayed. But clicking on it returns:               You do not have sufficient permissions to access this page.      I really don't know what to do. Any idea? Thanks UPDATE: Problem fixed. I was registering the menu using the wrong hook:               add_action('admin_init', 'function that runs the above code!');      must be:               add_action('admin_menu', 'function that runs the above code!');      Thanks.


title: I want a query to list tags

text: how are you? I want to using a string query to list tags in array and using it. I write this query but dosen't work               $tags= $wpdb->query("SELECT * FROM $wpdb->term_taxonomy , $wpdb->term_taxonomy WHERE $wpdb->term_taxonomy.taxonomy = post_tag");                              foreach($tags as $tag){     echo $tag;     }      please help me ..


title: Plugin that will let me specify a number of image sizes?

text: I've designed a grid-based portfolio theme for a photographer; for each portfolio item, I need six different images, all of which have a fixed size. However, no two sizes are alike. Is there a WordPress plugin that will easily allow me to specify a number of different image sizes and choose easily between them when uploading photos? Thanks!


title: Add gallery id to rel attribe of wp_get_attachment_link

text:
Now i have this snippet in my functions.php               /**      * Add rel to links.      */     function add_rel_to_gallery($link) {         return str_replace('<a href=', '<a data-fancybox="true" rel="group" href=', $link);     }     add_filter( 'wp_get_attachment_link', 'add_rel_to_gallery' );      Every link in gallery has **rel="group"** , but actually i want get something like that:               rel="group-$gallery-id"      How do this? **What is gallery id?**

      In this output gallery id is 1457. I need gallery id (or something that can grouped images from one gallery to one rel group) for create fancybox groups: > Note: ID's are single use and are only applied to one element. Galleries are > created from elements who have the same "data-fancybox-group" or "rel" > attribute value. via http://fancyapps.com/fancybox/#examples **To @s_ha_dum:**               function add_rel_to_gallery($link, $id) {       return str_replace('<a href=', '<a data-fancybox="true" rel="group-'.$id.'" href=', $link);     }     add_filter( 'wp_get_attachment_link', 'add_rel_to_gallery', 10, 2 );      Output:


title: What is archive.php used for?

text: **Dumb Questions Ahead:**   * If `index.php` and `archive.php` are practically the same thing, what's the point of having `archive.php`?   * When should I ever want to use `archive.php` over `index.php`?   * If I use front-page and Blog, it doesn't switch to `archive.php` which you might expect to and then use `index.php` in the place of `front-page.php`.


title: Infinite Scroll on a loop?

text:
I have a home page with four different loops (different category's) On one of the loops I want it to display five posts but also have the infinite scroll on it. I have installed the infinite scroll plugin but for the life of me I can't get it to work. Here is my code for the loop:

              <a href="<?php the_permalink() ?>" rel="bookmark" title="<?php printf( esc_attr__( 'Permalink to %s', 'gabfire' ), the_title_attribute( 'echo=0' ) ); ?>" class="thumbnail"><?php $url = wp_get_attachment_url(get_post_thumbnail_id($post->ID,'thumbnail') ); ?><img src="<?php echo $url ?>" alt="">

<a href="<?php the_permalink() ?>" rel="bookmark" title="<?php printf( esc_attr__( 'Permalink to %s', 'gabfire' ), the_title_attribute( 'echo=0' ) ); ?>"><?php the_title(); ?>

<?php the_excerpt(); ?>

                 by <?php echo get_the_author(); ?> |  <?php the_date(); ?> |  Cat: <a href="<?php echo esc_url( $category_link ); ?>"><?php $category = get_the_category(); echo $category[0]->cat_name;?>


title: TinyMCE onkeyup in front end

text:
I have post content field in the front end created using wp_editor function. I tested script which uses onkeyup in back end and it works fine. .js file:                   jQuery( document ).ready( function( $ ) {              $('

').insertAfter('#postbox-container-1');              $('#postContent').on('keyup', function( e ) {             repeater( e );         });     });               var repeater = function ( e ) {         var targetId = e.target.id;         var text = '';              switch ( targetId ) {                   case 'content':                  text = jQuery('#postContent').val();                  break;                   case 'tinymce':                  if ( tinymce.activeEditor )                      text = tinymce.activeEditor.getContent();                  break;         }              jQuery('#look-at-it').html( text );     }      functions.php:               function my_tiny_mce_before_init( $init ) {         $init['setup'] = "function( ed ) { ed.onKeyUp.add( function( ed, e ) { repeater( e ); }); }";         return $init;     }     add_filter( 'tiny_mce_before_init', 'my_tiny_mce_before_init' );      When i try to do the same in front end i get:               'KeyboardEvent.keyLocation'' is deprecated. Please use 'KeyboardEvent.location' instead.      What am I missing here?


title: Passing array in add_option()

text:
I have to create a option page in my custom theme wordpress. here is is a sample of code               <?php              function bguru_register_settings(){             $default_options=array(             'bguru_logo'=>'http://templategraphy.com/demo/businessguru/images/logo.png',             'bguru_vimeo'=>'',             'bguru_skype'=>'',             'bguru_dribbble'=>'',             'bguru_slide_one_image'=>'',             'bguru_slide_one_heading'=>'',             'bguru_slide_one_text'=>''              );                  add_option('bguru_options',$default_options);                  register_setting('tgbusinessguru', 'bguru_options');         }              add_action('admin_init', 'bguru_register_settings');              function bguru_register_options_page(){              add_theme_page('Business Guru Options', 'Theme Customizer', 'edit_theme_options', 'bguru-options', 'bguru_options_page');          }              add_action('admin_menu', 'bguru_register_options_page');              function bguru_options_page(){             $options=get_option('bguru_options');                  ?>
         <?php      screen_icon(); ?>
Business Guru Options
         <form method="post" action="options.php">              <?php      settings_fields('tgbusinessguru'); ?>

General

                              Logo:	                              <input type="text" id="bguru_logo" size="50" name="bguru_options[bguru_logo]" value="<?php echo $options['bguru_logo']; ?>" />

Social Links

                         Vimeo:	                         <input type="text" id="bguru_vimeo" size="50" name="bguru_options[bguru_vimeo]" value="<?php echo $options['bguru_vimeo']; ?>" />

                         Skype:	                         <input type="text" id="bguru_skype" size="50" name="bguru_options[bguru_skype]" value="<?php echo $options['bguru_skype']; ?>" />

                         Dribbble:	                         <input type="text" id="bguru_dribbble" size="50" name="bguru_options[bguru_dribbble]" value="<?php echo $options['bguru_dribbble']; ?>" />

                              Image:	                              <input type="text" id="bguru_slide_one_image" size="50" name="bguru_options[bguru_slide_one_image]" value="<?php      echo $options['bguru_slide_one_image']; ?>" />

                         Heading:	                         <input type="text" id="bguru_slide_one_heading" size="50" name="bguru_options[bguru_slide_one_heading]" value="<?php      echo $options['bguru_slide_one_heading']; ?>" />

                         Description:	                         <textarea type="text" id="bguru_slide_one_text" style="width:439px;height:100px;" name="bguru_options[bguru_slide_one_text]"><?php  echo $options['bguru_slide_one_text']; ?></textarea>

               <?php submit_button(); ?>            </form>
     <?php  } ?>      All the form details are passed by dashboard I want if admin forget to fill the logo field then by default this $default_options work so by default logo field fill up but when I try to access the array using get_option I'm not getting the results I expect.


title: GET Taxonomy ID

text: I have this line where "5" is the taxonomy ID. `<?php echo function xyz (5,'product_cat'); ?>` How can I change this to make it auto recognize always the taxonomy ID of the current page? Tried with no success this: `<?php echo function xyz (get_term_by('id','','product_cat);,'product_cat'); ?>` How can I do this? Thanks.


title: Replacing the content of an image attachment using API

text: I have an existing image attachment, with a given ID. Is there a way, using API (specifically, Python Wordpress XML-RPC), to upload another image instead of the existing one, without creating a new object with a new ID?


title: Prevent second widget activation

text: Is there a way to "remove the widget from available widgets" after you've activated it once on some area? The idea is to allow user to activate only one instance of it.


title: Hide posts having children terms when display posts by category in edit.php

text: I have a custom post type called `"ttc_infobit"` that belongs to a custom taxonomy named `"ttc_catalogue"`. This taxonomy is a hierarchical. When I filter posts in `edit.php` by this taxonomy, I want to show only posts having the currently selected term, and not its children. For example if my url is: `/wp- admin/edit.php?s&post_status=all&post_type=ttc_infobit&action=-1&m=0&lang=el&admin_page_template&ttc_catalogue=77&paged=1&mode=list&action2=-1` WordPress will shows posts having `ttc_catalogue` with id 77 but also shows posts having `ttc_catalogue` with ids 101 and 102 that are children ot the 77. How can I filter `edit.php` to show only items with id=77?


title: Remove the word 'Categories' from wp_list_categories

text: I've got the following code: `wp_list_categories();` It outputs all my categories, however, it makes them the child of a list element, called `CATEGORIES`. So, I get an unordered list, like so:               CATEGORIES     * FASHION     * DAILY FASHION CANDY     * TRENDS     * BEAUTY     * ACCESSORIES     * CELEBRITIES     * LIFESTYLE      However, I only need:               * FASHION     * DAILY FASHION CANDY     * TRENDS     * BEAUTY     * ACCESSORIES     * CELEBRITIES     * LIFESTYLE      I'm sure I could remove/hide the word `CATEGORIES` with JS or CSS, but is there a way to prevent it being there in the first place?


title: Strange behaviour using 3.8.1

text: I have upgraded some of my blogs into 3.8.1 and I am experiencing a strange behaviour. I have created in the past two types of themes that use mostly the same mechanism, assigning page templates. The difference between those two types is that in the first I also use the plugin "custom post type template" to assign template into CPT as well, while in the second, I have abolished the CPT for Posts and no template. (Posts in this situation are pure data entries of pictures, text and a couple of custom fields). The real problem is that when I access my 3.8.x admin from a safari browser (actually any webkit browser), I see old posts (that were trashed) and also page (or CPT) templates are being reset to default randomly. I have switched some in the 3.7.x branch and I don't see that problem. I can't seem to duplicate this problem at will. I don't use any caching plugins (the only plugins I have enabled are the custom post type template, WPML, WPML Media, WPML String translate and WPML translation manager, but I noticed this problem even with WPML disabled) Do anyone else experience this problem?


title: Problem with paging on Multisite

text:
I am using this loop too paginate, but it doesn't work. I have tried to set `$wp_query` `$paged` as `global` to but it didn´t help. I got the link to previous page, but then i click on the link I get a page that does not exist. ( page/2/ ) First I used the_query as variable instead of $wp_query, but then there will be no link at all. I am using a category template that using this loop-page. I am using it on a multisite on blog3. The code you can see below.
          <?php      // set the "paged" parameter (use 'page' if the query is on a static front page)     $paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1;     // $page = ( get_query_var( 'page' ) ) ? get_query_var( 'page' ) : 1;          $args = array('category_name' => 'pressmeddelande', 'posts_per_page' => 6, 'paged' => $paged);          // The Query     $wp_query = new WP_Query( $args ); // 'cat=4&paged=' . $paged          // The Loop     if ( $wp_query->have_posts() ) {         while ( $wp_query->have_posts() ) {             $wp_query->the_post(); ?>                  <article class="row loop" id="post-<?php the_ID(); ?>">
                     <a href="<?php the_permalink(); ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>">                     <?php if ( has_post_thumbnail() ) {                              the_post_thumbnail('thumbnail', array('class' => 'img-responsive')); }  ?>

<a href="<?php the_permalink(); ?>" rel="bookmark" title="Läs mer om <?php the_title_attribute(); ?>"><?php the_title(); ?>

<time datetime="<?php the_time('Y-m-d')?>">Publicerat <?php the_time('j F, Y') ?></time>. <?php if ( comments_open() ) : ?><a class="comment" href="<?php the_permalink(); ?>#comments"><?php comments_number('0 Kommentarer', '1 Kommentar', '% Kommentarer'); ?><?php endif; ?>
                                          <?php the_content(''); ?>
<a href="<?php the_permalink(); ?>"  title="Läs mer om <?php the_title_attribute(); ?>">Läs mer if  »

     <?php   }     } else {         // no posts found     } ?>
             <?php                 // usage with max_num_pages                 next_posts_link( '« Tidigare pressmeddelande' ); // $the_query->max_num_pages             ?>

             <?php                 previous_posts_link( 'Senare pressmeddelande »' );             ?>
                  <?php     /* Restore original Post Data */     wp_reset_postdata();        ?>
      Kind Regards, Mats Gustavsson


title: How to split out BuddyPress notifications drop down items to their own top level?

text: I am wondering if it's possible to split out notifications in the top bar (the ones that pop up in wp-top bar) to their own individual menu items: 'notifications' 'messages' and 'friend requests', rather than them all being under the notification drop down. Basically I'd like to achieve the effect that Facebook makes with their notifications. If any one could steer me in the right direction I would be most greatful p.s. I am a front end developer, not the most PHP savvy guy in the world. :)


title: Directly editing content on webpage, is it possible?

text: Is it possible to edit a website live? I.e simply click on the text you want to change and start typing. I've found something like this - http://plugins.elliotcondon.com/live-edit/. It's not quite what I want but it's close. So instead of clicking on some kind of admin button to open up a window you would click directly on the webpage to edit the text. Is it even possible?


title: Get the ID of the latest post

text: Been all over looking for the best way to do this. I want to get the ID of the latest post of a certain post_type. How can I do this in the cheapest way possible (by cheapest I mean using the least queries, and no loops or post rewinding)? Surely there is a quick method?


title: featured image is not showing

text: i have a problem with my website my feature images are not shown i have uploaded it as set as featured image but after so many tries there is no way to show the feature image please help me


title: How to automatically convert "%" and "+" in image urls on upload

text: I mass import products via csv and use this plugin http://wordpress.org/extend/plugins/cache-images/ to download the images to my server. Problem is some of the image urls have % and + characters in them and I get blank images from these. I always end up having to set the product images manually. Can anyone please give me the code to insert inside my plugin or maybe in my function.php? Thanks in advance.


title: Make editor required for post from frontend

text: I am trying to build a content submission form on the front end of my site, and I am using `wp_editor` to render visual text editors for my users, so they can make bold text and lists and stuff like that. The issue is that I can't figure out how to make the wp_editor a required field in my form. I know I can do the following for a standard text area.               <textarea id="content" name="content" required="required"></textarea>      that will make the browser itself recognize that it is a required field. No JavaScript jQuery or anything else needed. I need to accomplish the same thing with wp_editor, which does generate a textarea.


title: Enqueue scripts inside a class in a plugin

text: I have a plugin like this:               <?php     /*     Plugin Name: MyPlugin     */          class MyPlugin     {       public function __construct()       {         add_action('wp_enqueue_scripts', array($this, 'enqueueAssets'));       }            public function enqueueAssets()       {         wp_register_script('myplugin', plugins_url('myplugin.js', __FILE__), array('jquery'));         wp_enqueue_script('myplugin');       }            // More methods     }      The in a sidebar I create a new instance:               $plugin = new MyPlugin;      But when I open devtools in Chrome and go to "Sources" the assets are not being loaded. If I use a function _outside_ the class it works:               add_action('wp_enqueue_scripts', 'enqueueAssets');     function enqueueAssets()     {       wp_register_script('myplugin', plugins_url('myplugin.js', __FILE__), array('jquery'));       wp_enqueue_script('myplugin');     }          class MyPlugin     {      Am I missing something here?


title: Query Only Show Text on Posts With Certain Taxonomy Tag

text: I am trying to query in a post to show a fixed line of text at the end, so that if that post has a specific taxonomy tag applied to it (Special), then a line of text will show. I guess it's something simple, but can't get a query to work :( Would really appreciate any help!


title: WordPress Capabilities: edit_user vs edit_users

text: The official documentation only mentions `edit_users`, but in the source I found many places are using `edit_user`, what is the difference? Are there any conventions for singular and plural capabilities? e.g. `edit_post` vs `edit_posts`?


title: Hello dolly type plugin that allows people to add their own

text:
I am making a plugin that shows a random joke on a custom 404 page via shortcode and it is basically near enough the same as the default hello dolly plugin, where the jokes are hardcoded into the script. I want to be able to allow users to add their own jokes, maybe pulled from the database via custom post types, or just store it to a file which is pulled into the script (exploded or file_get_contents, i dont know) I am new to wordpress plugin development, but i know a fair amount of php. Heres the code i currently have to create an admin page               add_action('admin_menu', 'jokes_admin_add_page');     function jokes_admin_add_page() {     add_options_page('Jokes Page', 'Jokes Menu', 'manage_options', 'plugin', 'jokes_plugin_options_page');     }           // display the admin options page     function jokes_plugin_options_page() {     ?>

My custom plugin
     Options relating to the Custom Plugin.     <form action="options.php" method="post">     <?php settings_fields('plugin_options'); ?>     <?php do_settings_sections('plugin'); ?>          <input name="Submit" type="submit" value="<?php esc_attr_e('Save Changes'); ?>" />     </form>
          <?php     }


How to arrange the order of plugins displaying under every post? I got some plugins which display information, social media sharing, etc under every post. How can I arrange the display order?


title: Get Attachment Image Class by attachment id

text: I want Get wordpress media library image class. I have attachment id and I tired this but won't able to get it.               print_r(wp_get_attachment_image_src( $attachment_id, $size, $icon, $attr ));      How can I get it ?![enter image description here](http://i.stack.imgur.com/aqXlB.png)


title: add spans and characters into paginate_links

text: I am using paginate_links on my custom page query. What I have already works sweet and this is the code I have so far...               <?php         global $wp_query;              $big = 999999999; // need an unlikely integer              echo paginate_links( array(             'base'      => str_replace( $big, '%#%', get_pagenum_link( $big ) ),             'format'    => '?paged=%#%',             'current'   => max( 1, get_query_var('paged') ),             'total'     => $wp_query->max_num_pages,             'prev_text' => __('← Previous'),             'next_text' => __('Next →')         ));     ?>      Though I really need to be it a bit more different, but can't find any documentation on how to bend the rules with it. **Question 1**   I need the *prev_text* and *next_text* to be translatable. I have been adding my _theme text domain_ for localization through-out my theme. And on generic text strings, I have been using this `<?php _e('Latest Dowloads','mythemetextdomain'); ?>`. How can I add my theme text domain into the *prev_text* and *next_text* string. **Question 2**   How can I add `<span class="bracket">[</span>` and `<span class="bracket">]</span>` between each of my paginated page numbers? Please see image below of what my current pagination is looking like. ![enter image description here](http://i.stack.imgur.com/tkWt4.png) Now see image below of what I'm trying to achieve by using spans and brackets. ![enter image description here](http://i.stack.imgur.com/FVP9O.png) Can any help me modify my paginate query above to get these 2 things to work? Or is it not possible? Thanks


title: Theme development question regarding layouts

text: I am developing a WordPress template (or rather trying to) and need a bit of help/advice. I have a template that consists of a header (inc nav), footer, main content area. The main content area has two columns - the left column for a sub-menu and the right for content, as demonstrated by the crude diagram linked below. The right content area contains several more rows and columns which are different for most pages of the site - some have a series of rows and columns, others have a single row/column. I'm wondering what the best way to create these templates are - do I create several templates, each accommodating the different structure or is there a better way? The only thing that is inconsistent between each page is the right hand column (purple area), and it seems a shame to duplicate the entire page into a new template just because of this one inconsistent area, especially more so if I have different styles within the content area. I've added a screenshot to demonstrate two possible layouts! Edit: I don't have the required 10 reputation to post images unfortunately, so image is located here: ![enter image description here](http://i.stack.imgur.com/JxaX6.jpg)


title: Storing postID in session variable to query database when visitor on custom template page

text: I have an application with 3 custom post types, A, B, and C. The post types B and C are related to A using acf relationship fields. I've designed a single template for A post types. When viewing this template post meta from A, and B are queried and displayed. Upon login my users go to a dashboard and choose from a select list one of the A CPT (custom post types). This sets the postID in a session variable of A and they are redirected to A's permalink. Within the system my users need a way to view various pieces of data from all B and C CPT's so for each of these scenarios i've created a unique page with a custom template one to display all related B post meta, and the other page display's all of the C's post meta. Each user can have many A custom post types, all having their own unique B and C related post types. An example is A.1 B.1,B.1,B.1,B.1,B.1 C.1,C.1,C.1,C.1,C.1 A.2 B.2,B.2,B.2,B.2,B.2, C.2,C.2,C.2,C.2,C.2, I need some how to create unique URL's so they can bookmark and go directly to the custom page to show all of B.2 CPT's information which relates to A.2 CPT. Right now when they switch between A CPT's they use a select drop down which clears and resets the session variable storing the A CPT ID. So when they go to the page display B they see the correct related data. How can I setup pages / posts and unique permalink URL's without parameters so they can view the data. I know I could post ?val=23 to the pages and they could bookmark them but i'd much rather use a permalink structure if possible. Any suggestions on how to re-structure this?


title: How many  'wp_insert_post' calls can be performed in one shot, in a very long 'for' loop?

text: I'm working on a plugin which has bulk post inserts using a spreadsheet. This spreadsheet can have multiple thousand rows, each row corresponding to a post. I'm parsing this spreadsheet, looping over the parsed data and using `wp_insert_post` to insert the posts. I noticed that when I used a spreadsheet with around 2000 entries, only around 600 posts were inserted. Is there a limit on the number of `wp_insert_post` calls in one shot? Or could it be a limit on one shot `mysql` inserts? _(edited title for more clarity)_


title: How to link to custom "archive like" page with custom permalink rules "dynamically"

text: I am working on a plugin where I am trying to create a "archive like" page with permalinks. Here is what I have so far:   1. I've created a query var "experience"   2. I've created custom SQL selects using - "post_join" and "post_where" hooks   3. I've created a custom template using the "template_redirect" hook   4. I've added custom permalink rules and flushed them All good so far, the only thing I'm not getting is how I can link to my new archive like page "dynamically". I can create a static link like mysite.com/experience/id - but this will not work when permalinks are off. Also I tried to generate the URL like               url      This works when permalinks ar off and also when on, but this not changes to mysite.com/experience/id when they are on. It always remain mysite.com/?experience=id So what I would like to understand is how can I create those permalinks dynamically, so they will be recognized depending if permalinks are on/off. Thank you.


title: Count post + add number =

text: I'm having problems with counting posts of a custom post type called 'projects' and like to add a number to the count. We did some stuff which can't be shown in our portfolio but would like to add only as number. Basically it goes as follow: There are 22 published projects (custom posts type called 'projects') + 11 other projects (no posts) = echo 33 projects. Edit: I'm using this to get the wordpress counts:               <?php                 $count_posts = wp_count_posts('projects');                 $published_posts = $count_posts->publish;                 ?>          <?php // echo $published_posts  ?>      How do I get this working? Thanks in advance.


title: TinyMCE Format Dropdown as a Class Toggle

text: I'm developing a WP site that has 2 button styles that can be placed inside the Content Editor. So far I've been able to add classes as custom styles in the Format dropdown, but when I use that, it will apply the first button class chosen "red-button", and then if I change my mind, and choose the other button style, it applies the second class "blue-button", but keeps the first class "red-button". Here is my code so far:               // Add Formats Dropdown Menu To MCE     if ( ! function_exists( 'wpex_style_select' ) ) {         function wpex_style_select( $buttons ) {             array_push( $buttons, 'styleselect' );             return $buttons;         }     }     add_filter( 'mce_buttons', 'wpex_style_select' );          // Add new styles to the TinyMCE "formats" menu dropdown     if ( ! function_exists( 'wpex_styles_dropdown' ) ) {         function wpex_styles_dropdown( $settings ) {                  // Create array of new styles             $new_styles = array(                 array(                     'title' => __( 'Button Links', 'wpex' ),                     'items' => array(                         array(                             'title'     => __('Red Button','wpex'),                             'selector'  => 'a',                             'classes'   => 'red-button',                         ),                         array(                             'title'     => __('Blue Button','wpex'),                             'selector'  => 'a',                             'classes'   => 'blue-button',                         ),                     ),                 ),             );                  // Merge old & new styles             $settings['style_formats_merge'] = true;                  // Add new styles             $settings['style_formats'] = json_encode( $new_styles );                  // Return New Settings             return $settings;              }     }     add_filter( 'tiny_mce_before_init', 'wpex_styles_dropdown' );      What can I do to make the Button Links formats act as a Toggle instead? Not all links will be buttons, but any link should have the option. It should only ever have red-button or blue-button, but never both.


title: Access on specific pages in wordpress for a specific user

text: My Question is regarding User access control in wordpress I have two user - admin (admin access) and user1(editor). My requirement is admin can do any modification in admin site. But user1 can only edit and update some pages and no access other access except assigned pages. I have no idea how to implement this functionality so your help is required? My working environment :   1. wordpress v 3.2.1   2. Theme is twenty ten


title: Why do people use "admin" username by default?

text: WordPress users use "admin" username by default to login to admin panel because WordPress suggest this username at the end off install. But "admin" username is the most common username to brute-force because this username exists on the most part of sites powered by WordPress. WordPress does not limit login attempts by default. You can limit login attempts with "Limit Login Attempts" plugin. I installed this plugin on my site and I get about 1 brute-force attack each 3-5 days and every time the brute-forcers try to use "admin" username. Is there any benefits of using "admin" username by default?


title: WP order ASC in custom author loop

text:
My current author list shows authors with posts only, but its not ordered by `ASC` and its not working. Any ideas?
     <?php     // displays all users with their avatar and their posts (titles)     $blogusers = get_users_of_blog();     if ($blogusers) {         foreach ($blogusers as $bloguser) {             $user = get_userdata($bloguser->user_id);                  $args=array(                 'author' => $user->ID,                 'post_type' => 'post',                 'order' => 'ASC',                 'post_status' => 'publish'             );             $my_query = null;             $my_query = new WP_Query($args);                  if ( $my_query->have_posts() ) {                 echo '
';                 echo 'ID ).'">';                 if ( has_wp_user_avatar($user->ID) ) {                     echo '' . get_wp_user_avatar($user->ID, 128) . '';                 } else {                     echo '';                 }                 echo '
' . $user->user_firstname.' '.$user->user_lastname . '
';                 echo '';                 echo '
';             }                  wp_reset_query();  // Restore global post data stomped by the_post().         }     }     ?>
        * The reason I'm using this is WP default `wp_list_authors` has no avatar image option.


title: Showing Meta Box via Jquery Checkbox

text:
Ive been fooling around with both Jquery and PHP and Im trying to setup a website for a sports team. I've created a custom post type called "Matches" and in there I've created two Custom Meta Boxes. One for the match details (IE home and away team) and one for match stats (goals, shots etc.). What I currently have is a (Is This Game Complete) checkbox that shows/hides the statistics options (that are in a Div #meta_box_stats) in the Meta Box Details (#dw_match_details). The checkbox data value is saving but it isn't functioning quite properly. If it's checked as complete upon loading to edit and the value is set to 'on' it still won't show the stats meta box when I try to edit the post, I have to click it off and then click it on again. Here is my code (as brief as possible cause theres a lot going on). This is working, as I've done a var_dump on check and it changes accordingly to on or off and either shows the check or not. I want the stats to be hidden initially until the gamescore is entered. Once entered and checked as complete it should always show when you edit the page...I just cant figure out why it isnt. Here is My script                      As mentioned the custom data value "dw_complete" is saving and changing properly. EDIT: Here is some of the remaining code. I've essentially created two meta boxes, one called #dw_match_details which has the team selection and the checkbox on whether or not the game is complete.

Match Details

          <?php      $values = get_post_custom( $post->ID );     $check =  $values['dw_complete'][0];     ?>          <input type="checkbox" id="dw_complete" name="dw_complete" <?php checked( $check, 'on', true ); ?> />       Is This Game Complete?      Then I have my stats metabox.

     Goals Per Period:

                      	                     1st	                     2nd	                     3rd	                     OT	                     Total

      That's the gist of it, I obviously have more information going on for the stats section but think it should be irrelevant. If you need me to post that I can or Ill put it in a PasteBin. Before I forget here are the two calls to create my meta boxes.               function dw_custom_meta_boxes_match() {     add_meta_box( 'dw_match_details', 'Match Details', 'dw_match_details', 'dw_match', 'normal', 'high' );     add_meta_box('dw_match_display', 'Match Statistics', 'dw_match_display', 'dw_match', 'normal', 'low' );


title: Keeping parent menu items active in child pages

text:
I'm a begginer in php and css. I would like to know how to keep an top-menu item underlined while navigating on child pages. Here is my layout: I have a navigation menu, listing all my parent pages (main pages). Alls these pages will have a unique xxxxx*php file on which their respective childs will be created as well. On each of these xxxx*php file, there will be, what will look like, a sub menu. declared in my functions.php file. to each xxxxx.php file it's own sub menu. I know how to underline the current page menu item in css. but how do i keep the top menu item (main navigation item ) underlined while on the child pages... I hope i have made myself clear. In my fonctions.php file here is how i registered my personnal menus:               function register_my_menu()     {              register_nav_menus( array(             'home_menu' => __('Home Menu'),             'general_menu' => __('General Menu'),             'produit_menu' => __('Produit Menu'),             'pro_menu' => __('Pro Menu'),             'Stage_menu' => __('Stage Menu')         ) );      This i how i call the menus on each main pages (xxxxx.php)
Atelier de souffleur de verre:

 <?php wp_nav_menu( array( 'theme_location' => 'general_menu', 'container_class' => 'atelier_menu' ) ) ; ?>
      I create these menus in my admin page and write down the items i want to appear in my menu. It work fine, but as soon as i click on one of these child pages, my main menu item looses it's "underline" text décoration. Here is my css:               .current-sub-menu-item a { text-decoration:underline !important; }     .current-menu-item a { text-decoration:underline !important; }     .current-parent-page-item a { text-decoration:underline !important; }               /**Menu personnalisés**/     #page_title {text-decoration:none ;font-size:12px;color:#000000;}     #page_title a {text-decoration:underline ;font-size:12px;color:#000000;}     .atelier_menu { position:relative;left:160px;top:-27px;padding: 5px 0; }     .atelier_menu ul {list-style-type: none; }     .atelier_menu ul li { float: left; font-family:Times; }     .atelier_menu ul li a { display: block; padding: 5px 15px; color: #000000; font-size:     12px; text-decoration: none;}      Any help would be greatly appreciated. Regards, Siluvatar.


title: Looking for a way to exclude frontpage and nav menu from query filter

text:
maybe I'm thinking about this the wrong way, but I need to: A) exclude posts in queries site-wide (minus frontpage and navbar) based on a comparison with a meta_value, and B) orderby a differnt meta_value_num, then title this works:               function my_get_posts( $query ) {         $today = current_time( 'timestamp', 0 );         if ( ! is_admin() && ! is_home() && ! $query->is_page('Locations')) {             $query->set( 'meta_key', 'wpcf-post-weight' );             $query->set( 'orderby', 'meta_value_num title' );             $query->set( 'order', 'ASC' );                  $meta_query = array(                 array(                     'key' => 'wpcf-news-expire-date',                     'value' => $today,                     'compare' => '>='                 )             );                  $query->set( 'meta_query', $meta_query );         }              return $query;     }     add_filter( 'pre_get_posts', 'my_get_posts' );      But, since `pre_get_posts` can not use `is_front_page()` as a conditional, I'm a little stuck about how to exclude the front page. Would changing the hook to `parse_query`, then using `is_front_page()` be the way to go? Also, I notice that the pages this function gets called on no longer have the nav menu generated by Appearance>Menus. I can only assume this is because the menu is generated with a query. I have no idea how to exclude the nav query in particular. **EDIT:** Just noticed this seems to work on every page but the frontpage to exclude the nav menu `$query->query_vars['post_type'] != 'nav_menu_item'` Would there be any reason that the function has access to the query_vars being passed to WP_Query on every page except the front page? Only frontpage is throwing this error:               Notice:  Undefined property: WP_Query::$post in ...wp-includes/query.php on line 3034

     Notice:  Trying to get property of non-object in ...wp-includes/query.php on line 3402

     Notice:  Trying to get property of non-object in ...wp-includes/query.php on line 3404

     Notice:  Trying to get property of non-object in ...wp-includes/query.php on line 3406

     Notice:  Undefined property: WP_Query::$post in ...wp-includes/query.php on line 3034

     Notice:  Trying to get property of non-object in ...wp-includes/query.php on line 3402

     Notice:  Trying to get property of non-object in ...wp-includes/query.php on line 3404

     Notice:  Trying to get property of non-object in ...wp-includes/query.php on line 3406

     Notice:  Undefined index: post_type in ...lib/custom.php on line 1051      and lastly,...sadly,...`is_main_query()` just won't work. (we found ourselves in some sticky situations that required some secondary queries.) Any help or thoughts would be greatly appreciated. Thank you.


title: Delete Query won't run

text: This is the set up...               <form method="post" action="">     <input type="hidden" name="delete_app_id" id="delete_app_id" value='<?php echo $adoptee->app_id; ?>' />     <input type="submit" name="delete" value="delete" />     </form>     <?php             if(isset($_POST['delete']))     {     $delete_id=$_POST['delete_app_id'];          $adoptees_delete=$wpdb->query( "DELETE FROM $wpdb->rc_vol_adopt_apps WHERE app_id ='$delete_id'");     if ($adoptees_delete)     {     echo 'Record Deleted';     } else  {     echo 'have a ham sandwich - cause this FAILED';     }     }      And it won't run! It is picking up the delete_app_id and the delete from the post submit - but nothing happens after that. It's like it can't see the if isset statement. Please someone tell me it is something stoopid simple I am missing!


title: Change Fields of Comments and make them searchable?

text: What I am trying to do is a bit complex.. but I think it can be done. I wish to make a Wordpress website that allows anyone (not registered) to make a comment on a blog post. Only I'd like to add custom fields (Checkboxes and Text Fields)other than the default ones to the comments and display them with those fields. If possible I'd also like to somehow make these comments "Searchable" using tags or categories.. is this possible? Should I use Posts Instead? Thanks, ~Sean.


title: Is there a way to create a URL (new WP page) that can only be accessed from a specific source?

text: To explain further, here's what I"m looking to do:   1. Create a WP page   2. Use the URL and implement it in a reader service that is hosted (not downloadable) that in order to read (& access the URL) you would have needed to purchase a subscription.   3. Allow only visitors coming in from the guide access to the page (would be invisible if user clicked on it and tried accessing it from a different location) To simplify this explanation, I'm looking for a way to only give access to a specific URL from a specific URL. What would be the best route to take? Are there any plugins that could accomplish this?


title: How to Define Custom Number of Items in Comment Feed

text: Seeking a hook or code to override the Reading-Settings value for Syndication feeds show XXX items specifically for the comment feeds. Ideally I'd want to roll into a plugin I can network activate on a multiuser site. I am using Feed Wordpress to syndicate in comment feeds from about 100 student blogs on a multi-user site; I am seeing missed items because the comment feeds only provide 20 at a time (and we have a lot of comment activity). It would be nice to apply a plugin across their blogs to bump that comment feed item count to at least 40, while leaving the other feed settings at the default value.


title: Wordpress - 404 When creating Post/Page

text: I'm using the most recent version of WordPress and have encountered an issue that I've never seen before. Basically, when I try to publish a Page or a Post, WordPress directs me to a 404 page rather than publishing the post. What I've managed to find is that THIS ONLY OCCURS when I add content into the page/post. If I only enter a page title and then hit publish, it works perfectly fine. However, if I then try and edit that page/post and add content to it and then try to update, it goes to a 404 page again. A note:   * This is a brand new installation of WordPress on a cPanel (Linux) hosting environment - It has not been migrated from a previous host/website   * The Wordpress install is located in the root directory - Not a sub-domain/sub-directory   * No Plugins have been installed What I've tried so far, but to no avail:   * Reset permalinks   * Reverted to default theme   * Deleted autosaves/post backups from MySQL directly   * Restored the most recent Wodpress update from within the Admin dashboard   * Reset .htaccess   * Added "SecFilterEngine Off" to .htaccess After trying each of the above, the problem is still current. It appears it has something to do with the software saving the actual content of the page/post, as this is when the error occurs. Any ideas as to how to solve this?


title: How to get this value inside RETURN

text:
I'm doing something new & unexpected tonight with a lot of errors, and I have asked a lot of stupid questions tonight, so I promise this is the last one :) In last post, I received an answer that I can list all taxonomy terms in a list with following code:               <?php          $terms = get_terms('YOUR-TAXONOMY');         if ( $terms ) :     ?>

All
         <?php foreach ( $terms as $term ): ?>         <li class="filter" data-filter="<?php echo $term->slug; ?>"><?php echo esc_html($term->name); ?>
         <?php endforeach; ?>
     <?php endif; ?>      But how can I use this code in the plugin that I'm currently working, which looks like:               return      '
'      . '
slug .'>'. esc_html($term->name) .'
'     . '
'     . '
'     . '
'     . '
'     . $list      . '
'     . '
'     . '
'     . '
'.      Third line of the above code is the place where I want the list to appear. I did a lot of things, but WordPress is just returning some errors. Is it possible to run this code inside it. It's last question, and it will complete my first project, so please help :) Thanks!


title: Custom field to array?

text: I have a posts query that queries posts by ID but want to select those posts by enetering a custom field. Here is the query and where I want to put the custom field:               $query_args = array('post_type'=>'post', 'post_status'=>'publish', 'include' => '483,454, CUSTOM FIELD HERE', 'orderby' => 'date', 'order' => 'ASC');      More info: Custom field is listids and passed in include. But doesn't work.               <?php     &listids = get_post_meta($post->ID, 'list_array', true);     $query_args = array('post_type'=>'post', 'post_status'=>'publish', 'include' => 'echo $listids;', 'orderby' => 'date', 'order' => 'ASC');     $query_posts = get_posts($query_args);     $last_query = end($query_posts);     foreach ($query_posts as $post) : setup_postdata($post); ?>


title: Wordpress 3.9 breaks invalid permalinks.. code fix possible?

text: With wordpress 3.9 apparently some changes were made to how permalinks work internally. It seems that in my case these changes have caused some previously working pages to start returning 404 errors. Most of these problems apply to old posts written years ago when I presume Wordpress did not do such a good job of creating the permalink slug from the post title. So an old post might have the title **Ornamental design - Floral background** Which in my old post created a permalink of: **/articles/2184/1/Ornamental-design---Floral-background** Not very nice with the 3 dashes in there but at least it works. Now with 3.9 that is no longer the case.. the above permalink has stopped working and returns a 404. To fix this I have to go into wordpress, locate the post and press update.. which updates the slug internally changing it to what it should be: **/articles/2184/1/ornamental-design-floral-background** The problem is that this is effecting over 700 posts and I don't really want to have to locate each post in Wordpress admin and press update. I also have the added problem of the old url now returning a 301 after the update so I also loose a bit of Google PR because of this. **My question** Is there any way I can get WP 3.9 working with my old (not very nice) URLs? And if not is there any way I can bulk update the posts to correct the URL?


title: Ajax Request with jQuery not happening

text: My problem is: Can't do a POST request with jQuery. Down here is the complete description: I created a link in a page (using the plugin PHP code for posts and pages):               <?php         $nonce = wp_create_nonce("test_nonce");         $link = admin_url('admin-ajax.php?action=my_delete_object&object_id='.$object_id.'&nonce='.$nonce);              echo "<a data-object_id=\"".$object_id."\" data-nonce=\"".$nonce."\" href=\"".$link."\" class=\"delete-object\" >Click Here!</a>     ?>      Then I added this to my child theme's functions.php:               wp_enqueue_script( 'js_functions', get_bloginfo( 'stylesheet_directory' ) . '/js/functions.js', array( 'jquery' ), false);     wp_localize_script( 'js_functions', 'MyAjax', array( 'ajaxurl' => admin_url( 'admin-ajax.php' ) ) );          add_action("wp_ajax_my_delete_object", "my_delete_object");     add_action("wp_ajax_nopriv_my_delete_object", "my_must_login");               function my_delete_object() {         echo "<script> alert('test: ajax request reached action!') </script>";         // nonce check and other actions;         $result['type'] = "success";         die();      }          function my_must_login() {         //tell user to log in;         $result['type'] = "success";         die();     }      If I click the link, I get the alert _("test: ajax request reached action!")_ correctly and, if I add other actions to my_delete_object, they take place as well. The problem started when I wanted to add an ajax request to the scene. In my child theme's folder, I created the folder **js** , and put the file **functions.js** inside with the content:               jQuery(document).ready(function($) {              $(".delete-object").click( function(event) {           event.preventDefault();                object_id = $(this).attr("data-object_id");           nonce = $(this).attr("data-nonce");                $.post({              url : MyAjax.ajaxurl,              data : {action: 'my_delete_object', object_id: object_id, nonce: nonce},              success: function(response) {                 if(response.type == "success") {                    alert("Ajax request returned success!");                 }                 else {                    alert("Ajax request returned something else.");                 }              },              error: function(){                   alert("Ajax request no good");              }           });              alert('click triggered action!');        });           });      Then it does nothing when I click the link. It just pops the alert _"click triggered action!"_ , and nothing else. My conclusion is that the POST is not happening. Any ideas why?


title: How to connect database table to each registered wordpress user.

text: When registered user visit certain page, I want him to be able to add some 3 column data to a database that can be retrieved for him later. The way I see it implemented is by automatically adding an additional table in wordpress database for each registered user. Is this the correct approach, or is there a better/more efficient way to achieve it?


title: Using list_users give access to Users menu but not Role dropdown

text: I have user role that is the "Manager" of the e-commerce part of a site. I have given this user the capability, `list_user`so that they can access the "Users" page in Admin and add/change various user_meta fields we've created. That works fine. I used this post to stop these Managers from seeing the Administrator accounts when making their edits. It also works fine. Here's **the problem** : When the Managers access the "Users" menu in admin, they have access to the Roles dropdown menu - this means they can promote users to 'Administrator' - something I _really_ don't want! The Managers don't have the capability 'edit_roles' or 'list_roles' active. (I checked with the Members plugin) My **question** :   * How do I securely disable the ability for "Managers" to change roles if they have access to the Users page? More generally, is there a best way to restrict access/rights/visibility to sections of the Users page in admin?


title: Wordpress Search filter to remove possible script injections

text: I am trying to write a short plugin that will filter html characters from the search form. In the event someone enters in `<script>alert('some infectious js!');</script>` into the search form i want to remove the possibility of this command to be entered into the search form. I tried this:               function SearchFilter( $query ) {          if ( is_search() ) {               $query = strip_tags($query);               return;          }      }      add_action ('pre_get_posts', 'SearchFilter');      When I go to test it, i enter `<script>alert('some infectious js!');</script>` above into the search field and all I get is a blank white page in wordpress. The search still works but anytime i type in script it breaks the box. This seems odd that wordpress doesn't handle this by default OR am i totally wrong on this? Thanks in advance.


title: White spaces in username give 404 on author page

text: As the title says. When users register with white spaces in their usernames, if you try to go to their author page, you get a 404 error. Is there a way to fix the redirect? or should I add a filter to prevent the use of white spaces in usernames? The site is new, so it wouldn't be hard to just change the one author with the issue. I would think Wordpress would prevent people from having white spaces in their username.


title: Plugins Reverting Themself To Older Versions

text: While I'm using a custom theme that has some custom post types, a custom menu declaration, a support thumbnails declaration, and some Gravity Form's customization, whenever I try to update a plugin it updates, then a few page loads later the plugin reverts itself to the version previously installed. In some cases, it even corrupts the plugin and I can't use it anymore. I have the following plugins installed, ACF, Akismet, and Posts2Posts. Here is the error hat I get with debug set to true > Notice: Undefined index: REQUEST_URI in /wp-content/plugins/one-category- > only/oco.php on line 15 Notice: Undefined index: post in /wp- > content/plugins/one-category-only/oco.php on line 29 Notice: wpdb::prepare > was called incorrectly. The query argument of wpdb::prepare() must have a > placeholder. Please see Debugging in WordPress for more information. (This > message was added in version 3.9.) in wp-includes/functions.php on line 3245 I'm wondering if anyone has any suggestions for this?


title: get_posts not honoring post_status

text: I have a custom post type 'license' with custom post statuses 'active,inactive,cancel,expire'. However when I run a get_posts query to get only posts with active status it returns all the posts irrespective of the status.               $active_licenses = get_posts( array(             'post_type' => 'license',             'post_status'    => 'active',             'posts_per_page' => -1,             'orderby'        => 'ID',             'order'          => 'DESC',              ) );      I am unable to figure out what am I doing wrong.


title: How can I check if on specific plugin generated page or child

text: I am writing a function to force a redirect when accessing a certain page. I have done similar things using code like                if ( is_main_query() &&             ( is_singular($restricted_post_types)||is_single() )             && ! is_user_logged_in() ) {                 wp_redirect(...)       }      But now I want to target a certain class of pages (profile related pages in the bbpress plugin bc Genesis is destroying them). I don't know what I can use to identify this from an action in the template_redirect hook. I think anything with the pattern `'<baseurl>/forums/user'` would catch what I need


title: Replace category with page name in breadcrumb-navxt plugin

text: I am using the "breadcrumb-navxt" plugin and have following issue: I have a page and some posts in that page. When I go to that page and selects a post to display as single post the breadcrumb shows > Home>pagename>postname which is what I need, but when I hover over the link on `'pagename'` it shows `'category/postname'` which should be `'pagename'`. I found the following piece of code in `class.bcn_breadcrumb.php` file which might be generating the category of post but don't know what to replace it with;                   //Figure out the anchor for current category         $breadcrumb->set_url(get_term_link($term, $term->taxonomy));         }         //Get parents of current category         if($term->parent)         {             $this->term_parents($term->parent, $term->taxonomy);         }      I need to change category/postname to pagename.


title: Highlight Current Tag in wp_tag_cloud

text:
I'm in the middle of building a website and one of the pages will be a glossary. The first page of the glossary will display a list of all the words, which are custom post types assigned into a custom taxonomy called "letter" which pulls the first letter of the word. On top of the glossary, there is a "navigation" which is a a wp_tag_cloud of all the `letter`s (A-Z). The user can then click into the letter, and the page displays all of the words that start with that letter. The question I have is that if there is a way I can add a `current-tag` styling to the tag that I'm currently viewing. My code for this so far is this:

            <form role="search" method="get" id="searchform" action="<?php echo home_url( '/' ); ?>">
                             <?php wp_tag_cloud( array( 'taxonomy' => 'letter', 'format' => 'flat', 'hide_empty' => false) ); ?>                           <input type="text" value="Search the Glossary" onblur="if (this.value == '') {this.value = 'Search the Glossary';}" onfocus="if (this.value == 'Search the Glossary') {this.value = '';}" name="s" id="glossarySearch" />
           </form>

       Thanks so much for your help!


title: Apply `the_content' filter to theme customisation live preview

text: I'm using `'transport' => 'postMessage'` to update the text within the footer area during theme customisation live preview. My problem is that on my website, the corresponding theme setting (`footer_text`) has `the_content` filters applied to it. Is there any way to apply that filter via JS, or I am stuck with `'transport' => 'refresh'` for situations like this? Thanks.               (function($){              /** Update the footer text */         wp.customize('footer_text', function(value){             value.bind(function(newval){                 $('#footer-left').html(newval);             });         });          })(jQuery);


title: Adding iframe breaking admin bar

text: I need to add an iframe in my site footer for an opt-in form provided by a CRM. However when I add the iframe the admin bar disappears.               <iframe src="..." scrolling="no" frameborder="0" allowTransparency="true" marginheight="0" marginwidth="0" />      Anybody knows why this could be happening?