Saving widget gets an undefined variable

I am developing a widget for cached feeds. The widget itself works exactly as I want but I noticed that if I were to delete the widget and then add a new one (or simply just add a new one) on the first save I get an undefined variable error. This is in the admin Appearence->widgets section. `Notice: Undefined index: cached_feed1450-3 in D:\Sites\test.dev\wordpress\wp- admin\includes\ajax-actions.php on line 1578` It looks to me that this may be a WordPress issue since that line is:               if ( $form = $wp_registered_widget_controls[$widget_id] )      I guess they need to check `isset` I am pasting my widget here to make sure that this isn't an issue with my widget but confirmation that this is a WordPress bug. I really hope its the latter... Thanks for you help is identifying this issue. **EDIT:** This error only happens on when saving a new widget. It only seems to happen with my widget. When editing it's not an issue. I have a bootstrap for loading the plugin. I use this `add_action( 'widgets_init', array('BootStrap1450', 'addWidgets') );` in the               /**      * Initialize the BootStrap      */     public static function init() {         require_once(A1450COM_LIBRARY_PATH.'Functions1450.php');              // Initialize proper components (do not put into a hook!)         if (is_admin()) {             require_once(A1450COM_LIBRARY_PATH.'BackEnd1450.php');         } else {             require_once(A1450COM_LIBRARY_PATH.'FrontEnd1450.php');             FrontEnd1450::init(); // Call manually         }              // Initiation of WP hook         add_action( 'init', array('BootStrap1450', 'initWP') );         add_action( 'widgets_init', array('BootStrap1450', 'addWidgets') );     }       addWidgets is:               /**      * Adds widgets      */     public static function addWidgets() {         include_once(A1450COM_WIDGETS_PATH.'CachedFeed1450.php');     }      The widget file then follows:               <?php     /**      * An RSS feed widget with cache controls      * @package WordPress      * @subpackage Cached Feed Widget      * @author Jeremy      */     class CachedFeed1450 extends WP_Widget {         const TEXT_DOMAIN = 'cachedfeed';         const COUNT_LIMIT = 20;              /**          * Register widget with WordPress.          */         public function __construct() {                  $widget_options = array(                 'description' => __( 'A cached feed widget that gives you custom settings per feed.', self::TEXT_DOMAIN )             );                  $control_options = array(                 'width' => 300             );                  parent::__construct(                 'cached_feed1450', // Base ID                 __('Cached Feed', self::TEXT_DOMAIN), // Name                 $widget_options,                 $control_options             );         }              /**          * Front-end display of widget.          * *Currently only set for google news feed.          * @todo Create a feed object to handle multiple feeds different data structures          *          * @see WP_Widget::widget()          *          * @param array $args     Widget arguments.          * @param array $instance Saved values from database.          */         public function widget( $args, $instance ) {             extract( $args );             $title = apply_filters( 'widget_title', $instance['title'] );             $feedURL = $instance['feed'];             $count = absint($instance['count']);             $showWidgetTitle = $instance['show_widget_title'];             $showTitle = $instance['show_title'];             $showContent = $instance['show_content'];             $showAuthor = $instance['show_author'];             $showDate = $instance['show_date'];             $enableCache = $instance['enable_cache'];             $cacheLifetime = $instance['cache_lifetime'];                  echo $before_widget;             if ( $showWidgetTitle && !empty( $title ) ) {                 echo $before_title . $title . $after_title;             }                  $results = self::getFeed($widget_id, $feedURL, $count);             if (!empty($results)) {                 echo '
';                 // @todo Design a decent layout                 foreach($results as $feed) {                     echo '
';                          if ($showTitle)                         echo $feed->title;                          if ($showContent)                         echo $feed->description;                          if ($showDate)                         echo $feed->pubDate;          //                echo $feed->link;                          echo '
';                 }                 echo '
';             }             echo $after_widget;             return;         }              /**          * Sanitize widget form values as they are saved.          *          * @see WP_Widget::update()          *          * @param array $new_instance Values just sent to be saved.          * @param array $old_instance Previously saved values from database.          *          * @return array Updated safe values to be saved.          */         public function update( $new_instance, $old_instance ) {                  $instance = $old_instance; // Sets defaults to old values             $instance['title'] = strip_tags($new_instance['title']);             $instance['feed'] = strip_tags($new_instance['feed']);             $instance['count'] =  absint($new_instance['count']);             $instance['show_title'] = !empty($new_instance['show_title']) ? '1' : '0';             $instance['show_content'] = !empty($new_instance['show_content']) ? '1' : '0';             $instance['show_author'] = !empty($new_instance['show_author']) ? '1' : '0';             $instance['show_date'] = !empty($new_instance['show_date']) ? '1' : '0';             $instance['enable_cache'] = !empty($new_instance['enable_cache']) ? '1' : '0';             $instance['show_widget_title'] = !empty($new_instance['show_widget_title']) ? '1' : '0';             $instance['cache_lifetime'] =  absint($new_instance['cache_lifetime']) * 60; // * 60 is to convert the seconds to minutes                  // Clean the array             array_walk($instance, array(__CLASS__, 'trim'));                  // Fail-safe             if (empty($instance['feed'])) {                 return false;             }             return $instance;         }              /**          * Workaround to trim array on array_walk          * @param $value          */         public static function trim(&$value) {             $value = trim($value);         }              /**          * Back-end widget form.          *          * @see WP_Widget::form()          *          * @param array $instance Previously saved values from database.          */         public function form( $instance ) {             // Build data             $title = !empty($instance[ 'title' ]) ? $instance[ 'title' ] : '';             $feed = !empty($instance[ 'feed' ]) ? $instance[ 'feed' ] : '';             $count = !empty($instance[ 'count' ]) ? $instance[ 'count' ] : 0;             $cacheLifetime = !empty($instance[ 'cache_lifetime' ]) ? ($instance[ 'cache_lifetime' ] / 60) : 3600; // Default is 1 hour             $showTitle = !empty($instance[ 'show_title' ]) ? true : false;             $showContent = !empty($instance[ 'show_content' ]) ? true : false;             $showAuthor = !empty($instance[ 'show_author' ]) ? true : false;             $showDate = !empty($instance[ 'show_date' ]) ? true : false;             $enableCache = !empty($instance[ 'enable_cache' ]) ? true : false;             $showWidgetTitle = !empty($instance[ 'show_widget_title' ]) ? true : false;             ?>
                 <label for="<?php echo $this->get_field_id( 'feed' ); ?>"><?php _e( 'Feed URL:', self::TEXT_DOMAIN ); ?>                 <input class="widefat" id="<?php echo $this->get_field_id( 'feed' ); ?>" name="<?php echo $this->get_field_name( 'feed' ); ?>" type="text" value="<?php echo esc_attr( $feed ); ?>" />

                 <label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title: (optional)', self::TEXT_DOMAIN ); ?>                 <input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" />

                 <input type="checkbox" id="<?php echo $this->get_field_id( 'show_widget_title' ); ?>" name="<?php echo $this->get_field_name( 'show_widget_title' ); ?>" value="1" <?php checked($showWidgetTitle, 1) ?> />                 <label for="<?php echo $this->get_field_id( 'show_widget_title' ); ?>"><?php _e( 'Display the widget title?', self::TEXT_DOMAIN ); ?>

                 <label for="<?php echo $this->get_field_id( 'count' ); ?>"><?php _e( 'How many items would you like to display?:', self::TEXT_DOMAIN ); ?>                 <select id="<?php echo $this->get_field_id( 'count' ); ?>" name="<?php echo $this->get_field_name( 'count' ); ?>" >                     <?php                     for($i=1; $i <= self::COUNT_LIMIT; $i++) {                         echo '<option value="'.$i.'" '.selected($i, $count, false).'>'.$i.'</option>';                     }                     ?>                 </select>

                 <input type="checkbox" id="<?php echo $this->get_field_id( 'show_title' ); ?>" name="<?php echo $this->get_field_name( 'show_title' ); ?>" value="1" <?php checked($showTitle, 1) ?> />                 <label for="<?php echo $this->get_field_id( 'show_title' ); ?>"><?php _e( 'Display the item title?', self::TEXT_DOMAIN ); ?>

                 <input type="checkbox" id="<?php echo $this->get_field_id( 'show_content' ); ?>" name="<?php echo $this->get_field_name( 'show_content' ); ?>" value="1" <?php checked($showContent, 1) ?> />                 <label for="<?php echo $this->get_field_id( 'show_content' ); ?>"><?php _e( 'Display item content?', self::TEXT_DOMAIN ); ?>

                 <input type="checkbox" id="<?php echo $this->get_field_id( 'show_author' ); ?>" name="<?php echo $this->get_field_name( 'show_author' ); ?>" value="1" <?php checked($showAuthor, 1) ?> />                 <label for="<?php echo $this->get_field_id( 'show_author' ); ?>"><?php _e( 'Display item author if available?', self::TEXT_DOMAIN ); ?>

                 <input type="checkbox" id="<?php echo $this->get_field_id( 'show_date' ); ?>" name="<?php echo $this->get_field_name( 'show_date' ); ?>" value="1" <?php checked($showDate, 1) ?> />                 <label for="<?php echo $this->get_field_id( 'show_date' ); ?>"><?php _e( 'Display item date?', self::TEXT_DOMAIN ); ?>

                 <input type="checkbox" id="<?php echo $this->get_field_id( 'enable_cache' ); ?>" name="<?php echo $this->get_field_name( 'enable_cache' ); ?>" value="1" <?php checked($enableCache, 1) ?> class="cachedform-cache-toggle" />                 <label for="<?php echo $this->get_field_id( 'enable_cache' ); ?>"><?php _e( 'Enable Cache?', self::TEXT_DOMAIN ); ?>

                 <label for="<?php echo $this->get_field_id( 'cache_lifetime' ); ?>"><?php _e( 'Cache lifetime:', self::TEXT_DOMAIN ); ?>                 <input id="<?php echo $this->get_field_id( 'cache_lifetime' ); ?>" name="<?php echo $this->get_field_name( 'cache_lifetime' ); ?>" type="text" value="<?php echo esc_attr( $cacheLifetime ); ?>" />                 <?php _e('In minutes', self::TEXT_DOMAIN); ?>
                  <?php         }              /**          * Get the feed data          * @param string $id          * @param string $feed_url          * @param int $limit          * @param bool $sendRaw          * @param null $cacheTime          * @return array|SimpleXmlElement          */         private function getFeed($id, $feed_url, $limit = 0, $sendRaw = false, $cacheTime = 0) {             if (empty($cacheTime)) {                 $cacheTime = 3600; // 1 hour cache by default             }                  // Define cache file             $cache_file = get_theme_root() . DIRECTORY_SEPARATOR . get_template() . DIRECTORY_SEPARATOR . 'cached-feed-'.$id.'.xml';                  // Check for cache             $tmpFileModifiedDate = @filemtime($cache_file);             $timedif = time() - $tmpFileModifiedDate;             if (file_exists($cache_file) && $timedif < $cacheTime) {                 $string = file_get_contents($cache_file);             } else {                 $string = @file_get_contents($feed_url);                 // Check if an error and attempt a quick fix                 if ($string === false) {                     $string = @file_get_contents(urlencode($feed_url));                 }                 if ($string === false) {                     trigger_error(__('Cached Feed Error - Fetch feed content', self::TEXT_DOMAIN));                     return false;                 }                 if ($string) {                     $f = fopen($cache_file, 'w');                     if ($f === false) {                         trigger_error(__('Cached Feed Error - Failed to write to cache file', self::TEXT_DOMAIN));                         return false; // Failed to write to file                     }                     if ($f) {                         fwrite($f, $string, strlen($string));                         fclose($f);                     }                 }             }                  // Return empty array if no data             if (!$string) {                 return array();             }                  // Get content from XML             $x = new SimpleXmlElement($string);             if ($sendRaw) {                 return $x;             }             $entries = array();             $i = 0;             foreach ($x->channel->item as $entry) {                 if ($limit > 0 && $i >= $limit) {                     continue;                 }                 $entries[] = $entry;                 $i++;             }     //            die('
'.print_r($entries, true).'
');             return $entries;         }     }     register_widget( 'CachedFeed' );


How to Insert Popup box shortcode in wordpress

I create a Tinymce Popup box for inserting shortcode on content area in wordpress. When I click shortcode button then popup box open successfully with input field. But when I click popup box insert button then noting happen. I search on google and try so hard but I can't find out the problem. Please, anyone can help me. In the following is my popbox code:               <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">               <title>Insert Button</title>                    <link rel="stylesheet" href="includes/css/friendly_buttons_tinymce.css" />
             <form action="/" method="get" accept-charset="utf-8">
                     Button URL                     <input type="text" name="button-url" value="" id="button-url" />

                     Button Text                     <input type="text" name="button-text" value="" id="button-text" />

                     Size                     <select name="button-size" id="button-size" size="1">                         <option value="small">Small</option>                         <option value="medium" selected="selected">Medium</option>                         <option value="large">Large</option>                     </select>

                     Style                     <select name="button-style" id="button-style" size="1">                         <option value="less_round">Less Round</option>                         <option value="round" selected="selected">Round</option>                         <option value="square">Square</option>                     </select>

                     Color                     <select name="button-color" id="button-color" size="1">                         <option value="gray" selected="selected">Gray</option>                         <option value="blue"=>Blue</option>                         <option value="red">Red</option>                         <option value="green">Green</option>                         <option value="black">Black</option>                     </select>

                     Alignment                     <select name="button-align" id="button-align" size="1">                         <option value="gray" selected="selected">None</option>                         <option value="left"=>Left</option>                         <option value="right">Right</option>                     </select>

                        Insert
             </form>


Custom post type RSS feed, multiple post published on same day bug

I'm working on a plugin that will create a custom post type for press releases. The objective is to give the user the ability to easily create a press release in the standard press release format. An example would be: > **FOR IMMEDIATE RELEASE** > > Title Here > > **City, State (Month Year)** - Paragraph 1 > > Paragraph 2 > > So on... > > Contact:   >  PR Rep Name   >  Title   >  Company   >  Phone: #   >  Fax: # > > **# # #** The plugin has custom fields for the contact info, automatically prepends the "FOR IMMEDIATE RELEASE", etc. The whole idea is that you just write the content for the release and everything else is taken care of for you. I am trying to create a custom RSS feed for this post type which will use these custom fields and display everything correctly. I have it basically working except for one bug I'm noticing. If multiple press releases were published on the same day, only the most recent will show the date. The rest are blank where the date should appear. Here is my code for the feed: (modified version of /wp-includes/feed-rss2.php)               <?php          header('Content-Type: ' . feed_content_type('rss-http') . '; charset=' . get_option('blog_charset'), true);     $more = 1;          echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>'; ?>          <rss version="2.0"         xmlns:content="http://purl.org/rss/1.0/modules/content/"         xmlns:wfw="http://wellformedweb.org/CommentAPI/"         xmlns:dc="http://purl.org/dc/elements/1.1/"         xmlns:atom="http://www.w3.org/2005/Atom"         xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"         xmlns:slash="http://purl.org/rss/1.0/modules/slash/"         <?php do_action('rss2_ns'); ?>     >          <channel>         <title><?php bloginfo_rss('name'); ?></title>         <atom:link href="<?php self_link(); ?>" rel="self" type="application/rss+xml" />         <link><?php bloginfo_rss('url') ?></link>         <description><?php bloginfo_rss("description") ?></description>         <lastBuildDate><?php echo mysql2date('D, d M Y H:i:s +0000', get_lastpostmodified('GMT'), false); ?></lastBuildDate>         <language><?php bloginfo_rss( 'language' ); ?></language>         <sy:updatePeriod><?php echo apply_filters( 'rss_update_period', 'hourly' ); ?></sy:updatePeriod>         <sy:updateFrequency><?php echo apply_filters( 'rss_update_frequency', '1' ); ?></sy:updateFrequency>         <?php do_action('rss2_head'); ?>         <?php         while( have_posts()) : the_post();         $pr_option = get_option('bacpr_option');         $pr_meta = get_post_custom();         $pr_date_format = ($pr_option["date_format"] != null && $pr_option["date_format"] != "") ? $pr_option["date_format"]:"F j, Y";         ?>         <item>             <title><?php the_title_rss() ?></title>             <link><?php the_permalink_rss() ?></link>             <pubDate><?php echo mysql2date('D, d M Y H:i:s +0000', get_post_time('Y-m-d H:i:s', true), false); ?></pubDate>             <?php the_category_rss('rss2') ?>                  <guid isPermaLink="false"><?php the_guid(); ?></guid>              <?php              $content = "
FOR IMMEDIATE RELEASE

".the_title_rss()."
";              if ($pr_meta["insert_summary"][0] == 1) {             $content .= "
".$pr_meta["summary"][0]."
";         }              ob_start();         the_content('rss2');         $original_content = ob_get_contents();         ob_end_clean();              $startpos = strpos($original_content, "
", $startpos);              $new_content = substr($original_content, 0, $endpos+1);         $new_content .= "".$pr_meta['location'][0]." ".the_date($pr_date_format, '(', ')', false)." - ";         $new_content .= substr($original_content, $endpos+1);              $content .= $new_content;              $content .= "
Contact:
";         $content .= ($pr_meta["signature1"][0] != null || $pr_meta["signature1"][0] != "") ? $pr_meta["signature1"][0]."
":"";         $content .= ($pr_meta["signature2"][0] != null || $pr_meta["signature2"][0] != "") ? $pr_meta["signature2"][0]."
":"";         $content .= ($pr_meta["signature3"][0] != null || $pr_meta["signature3"][0] != "") ? $pr_meta["signature3"][0]."
":"";         $content .= ($pr_meta["email"][0] != null || $pr_meta["email"][0] != "") ? "".$pr_meta["email"][0].""."
":"";         $content .= ($pr_meta["address1"][0] != null || $pr_meta["address1"][0] != "") ? $pr_meta["address1"][0]."
":"";         $content .= ($pr_meta["address2"][0] != null || $pr_meta["address2"][0] != "") ? $pr_meta["address2"][0]."
":"";         $content .= ($pr_meta["address3"][0] != null || $pr_meta["address3"][0] != "") ? $pr_meta["address3"][0]."
":"";         $content .= ($pr_meta["phone"][0] != null || $pr_meta["phone"][0] != "") ? "Phone: ".$pr_meta["phone"][0]."
":"";         $content .= ($pr_meta["fax"][0] != null || $pr_meta["fax"][0] != "") ? "Fax: ".$pr_meta["fax"][0]."
":"";         $content .= ($pr_meta["web"][0] != null || $pr_meta["web"][0] != "") ? "".$pr_meta["web"][0].""."
":"";         $content .= "

";         $content .= ($pr_option["ends_with"] == 2) ? "ENDS":"# # #";         $content .= "
";              ?>              <content:encoded><![CDATA[<?php echo $content; ?>]]></content:encoded>          <?php rss_enclosure(); ?>         <?php do_action('rss2_item'); ?>         </item>         <?php endwhile; ?>     </channel>     </rss>      Basically I'm at a loss and I thought I'd turn to you folks for help. Thanks in advance to anyone who helps me out here.


Submitting a post with no title or content gives success message "Post Published"

When you add a new post in WordPress and don't fill in anything then press publish, you get a success message saying "Post Published!" I believe this is because of the auto-draft feature in WordPress which pre populates the title field with "Auto Draft" so it is not empty. However the post status is still draft (Even though it does not appear in the drafts list in the administration area) and it does not appear on the front end of the website. How can I hide this success message and replace it with an error message like "You can't submit empty content?" I know it doesn't really matter because my users can't submit empty content anyway but I'm interested in trying anyway.


Marginal pagination on home.php

I'm trying too make a custom wp-theme and use a few loops in `home.php`. But now I can't finish `home.php` because of pagination. How cant I realize any type of pagination with saving that kind of structure? Here is my code:

                 <?php                          global $post;                         global $wp_query;                         $args = array( 'numberposts' => 6, 'category' => 150 );                         $myposts = get_posts( $args );                         foreach( $myposts as $post ) :  setup_postdata($post);                          $page=get_page_by_title($page_name);?>
                                    <div class="box-image" style=" background-image: url(<?php echo catch_that_image();?>);">

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

                 <?php endforeach; ?>

                       <?php                         global $post;                         global $wp_query;                         $args = array( 'numberposts' => 6, 'category' => 101 );                         $myposts = get_posts( $args );                         foreach( $myposts as $post ) :  setup_postdata($post);                          $page=get_page_by_title($page_name);?>
                             <div class="box-image" style=" background-image: url(<?php echo catch_that_image();?>);">

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

                 <?php endforeach; ?>

                      <?php                         global $post;                         global $wp_query;                         $args = array( 'numberposts' => 6, 'category' => 26 );                         $myposts = get_posts( $args );                         foreach( $myposts as $post ) :  setup_postdata($post);                          $page=get_page_by_title($page_name);?>
                             <div class="box-image" style=" background-image: url(<?php echo catch_that_image();?>);">

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

                 <?php endforeach; ?>

             <?php                         global $post;                         global $wp_query;                         $args = array( 'numberposts' => 6, 'category' => 31 );                         $myposts = get_posts( $args );                         foreach( $myposts as $post ) :  setup_postdata($post);                          $page=get_page_by_title($page_name);?>
                             <div class="box-image" style=" background-image: url(<?php echo catch_that_image();?>);">

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

                 <?php endforeach; ?>

                  <?php                         global $post;                         global $wp_query;                         $args = array( 'numberposts' => 6, 'category' => 30 );                         $myposts = get_posts( $args );                         foreach( $myposts as $post ) :  setup_postdata($post);                          $page=get_page_by_title($page_name);?>
                             <div class="box-image" style=" background-image: url(<?php echo catch_that_image();?>);">

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

                 <?php endforeach; ?>

                      <?php                         global $post;                         global $wp_query;                         $args = array( 'numberposts' => 6, 'category' => 663 );                         $myposts = get_posts( $args );                         foreach( $myposts as $post ) :  setup_postdata($post);                          $page=get_page_by_title($page_name);?>
                             <div class="box-image" style=" background-image: url(<?php echo catch_that_image();?>);">

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

                 <?php endforeach; ?>
      And here is the working example: http://newstock.org.ua/


Forcing a term/taxonomy on all posts of CPT

I have a CPT - 'Events' with 400+ posts [with no terms in the custom taxonomy (tax_category) selected] in them, as I recently imported those posts. Now, I've created a URL structure where I need to have some term of tax_category assigned to each post. So, is there any way with which I can assign a term from tax_category (say 'New Gigs') to all posts of the Events cpt? While searching I also found the following code, but am confused of how can I modify it suit my need or it even is the solution am looking for? -               function mfields_set_default_object_terms( $post_id, $post ) {         if ( 'publish' === $post->post_status ) {             $defaults = array(                 'post_tag' => array( 'taco', 'banana' ),                 'monkey-faces' => array( 'see-no-evil' ),                 );             $taxonomies = get_object_taxonomies( $post->post_type );             foreach ( (array) $taxonomies as $taxonomy ) {                 $terms = wp_get_post_terms( $post_id, $taxonomy );                 if ( empty( $terms ) && array_key_exists( $taxonomy, $defaults ) ) {                     wp_set_object_terms( $post_id, $defaults[$taxonomy], $taxonomy );                 }             }         }     }     add_action( 'save_post', 'mfields_set_default_object_terms', 100, 2 );       Code Source - http://wordpress.mfields.org/2010/set-default-terms-for-your- custom-taxonomies-in-wordpress-3-0/


Is there a query string for edit.php to show all posts that have no custom taxonomy terms?

I wrote a plugin Premium Posts that registers a custom taxonomy called **sms_premium_posts** and adds a column to the post list table in the WordPress administration area. In that custom column, if a post has been marked **Premium** , the term **Premium** links to a filtered list of only premium posts. This link is generated using the query string: http://www.example.com/wp-admin/edit.php?sms_premium_posts=premium If a post is not marked as **Premium** , I would like the term **Standard** to filter the list so the table only shows posts that are NOT marked as premium (i.e. posts with no taxonomy terms). Is there a query string for that? **Example query string:**   http://www.example.com/wp-admin/edit.php?sms_premium_posts!=premium You may ask, _"Why not add the term **Standard** to all other posts?"_ My reason for not doing that is, it would require tagging all existing posts with a custom taxonomy term when the plugin is activated...which seems pretty inefficient. Thanks in advance! **SOLUTION** Based on the answer from @s_ha_dum below, here is what I did to fake a negative query string:               function standard_term_filter( $query ) {         if ( ! $query->is_admin || ! isset( $_GET['sms_premium_posts!'] ) )             return $query;              if ( 'premium' == $_GET['sms_premium_posts!'] ) {             $taxquery = array(                 array(                     'taxonomy' => 'sms_premium_posts',                     'field'    => 'slug',                     'terms'    => 'premium',                     'operator' => 'NOT IN'                 )             );             $query->set( 'tax_query', $taxquery );         }         return $query;     }     add_action( 'pre_get_posts', array( $this, 'standard_term_filter' ) );      Note that I added this function as a method of my plugin class, which is why I used an array for the callback in add_action(). Also note the ! at the end of my query string term: **sms_premium_posts!** I made my **Standard** term links look like this: http://www.example.com/wp-admin/edit.php?sms_premium_posts!=premium Since **sms_premium_posts!** is different than **sms_premium_posts** (the slug of my custom taxonomy), it works.


How to show a 'correct' message after submit a form?

I'm building a template page for submit a profile changes. I would like to show a 'correct' message in green(example) for the user knows. Here my template code:               <?php     global $avia_config;     /**      * Template Name: User Profile      *      * Allow users to update their profiles from Frontend.      *      */          /* Get user info. */     global $current_user, $wp_roles;     get_currentuserinfo();          /* Load the registration file. */     require_once( ABSPATH . WPINC . '/registration.php' );     $error = array();     $correct = array();         /* If profile was saved, update profile. */     if ( 'POST' == $_SERVER['REQUEST_METHOD'] && !empty( $_POST['action'] ) && $_POST['action'] == 'update-user' ) {              /* Update user password. */         if ( !empty($_POST['pass1'] ) && !empty( $_POST['pass2'] ) ) {             if ( $_POST['pass1'] == $_POST['pass2'] )                 wp_update_user( array( 'ID' => $current_user->ID, 'user_pass' => esc_attr( $_POST['pass1'] ) ) );             else                 $error[] = __('The passwords you entered do not match.  Your password was not updated.', 'profile');         }              /* Update user information. */         if ( !empty( $_POST['url'] ) )             update_user_meta( $current_user->ID, 'user_url', esc_url( $_POST['url'] ) );              if ( !empty( $_POST['nickname'] ) )             update_user_meta( $current_user->ID, 'nickname', esc_attr( $_POST['nickname'] ) );              if ( !empty( $_POST['description'] ) )             update_user_meta( $current_user->ID, 'description', esc_attr( $_POST['description'] ) );              /* Redirect so the page will show updated info.*/       /*I am not Author of this Code- i dont know why but it worked for me after changing below line to if ( count($error) == 0 ){ */         if ( count($error) == 0 ) {             $correct[] = __('Correct message', 'profile');             //action hook for plugins and extra fields saving             do_action('edit_user_profile_update', $current_user->ID);             wp_redirect( get_permalink() );             exit;         }     }         /*          * get_header is a basic wordpress function, used to retrieve the header.php file in your theme directory.          */          get_header();                    if( get_post_meta(get_the_ID(), 'header', true) != 'no') echo avia_title();          ?>                  <div class='container_wrap container_wrap_first main_color <?php avia_layout_class( 'main' ); ?>'>
                          <main class='template-page content  <?php avia_layout_class( 'content' ); ?> units' <?php avia_markup_helper(array('context' => 'content','post_type'=>'page'));?>>                              <?php                         /* Run the loop to output the posts.                         * If you want to overload this in a child theme then include a file                         * called loop-page.php and that will be used instead.                         */                         if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>         <div id="post-<?php the_ID(); ?>">
                 <?php the_content(); ?>                 <?php if ( !is_user_logged_in() ) : ?>
                             <?php _e('You must be logged in to edit your profile.', 'profile'); ?>
                 <?php else : ?>                          <form method="post" id="adduser" action="<?php the_permalink(); ?>">
                             <?php _e('Nickname *', 'profile'); ?>                             <input class="text-input" name="nickname" type="text" id="nickname" value="<?php the_author_meta( 'nickname', $current_user->ID ); ?>" />

                             <?php _e('Username (Not editable)','profile')?>                             <input class="text" name="username" type="text" id="username" readonly value="<?php the_author_meta( 'user_login', $current_user->ID ); ?>"/>

                             <?php _e('E-mail (Not editable)', 'profile'); ?>                             <input class="text-input" name="email" type="text" id="email" readonly value="<?php the_author_meta( 'user_email', $current_user->ID ); ?>" />

                             <?php _e('Website', 'profile'); ?>                             <input class="text-input" name="url" type="text" id="url" value="<?php the_author_meta( 'user_url', $current_user->ID ); ?>" />

                             <?php _e('Password *', 'profile'); ?>                              <input class="text-input" name="pass1" type="password" id="pass1" />

                             <?php _e('Repeat Password *', 'profile'); ?>                             <input class="text-input" name="pass2" type="password" id="pass2" />

                             <?php _e('Biographical Information', 'profile') ?>                             <textarea name="description" id="description" rows="3" cols="50"><?php the_author_meta( 'description', $current_user->ID ); ?></textarea>
                              <?php                              //action hook for plugin and extra fields                             do_action('edit_user_profile',$current_user);                          ?>                          <?php if ( count($error) > 0 ) echo '
' . implode("
", $error) . '
'; ?>                         <?php if ( count($correct) > 0 ) echo '
' . implode("
", $correct) . '
'; ?>
                             <?php echo $referer; ?>                             <input name="updateuser" type="submit" id="updateuser" class="submit button" value="<?php _e('Update', 'profile'); ?>" />                             <?php wp_nonce_field( 'update-user' ) ?>                             <input name="action" type="hidden" id="action" value="update-user" />
                     </form>                 <?php endif; ?>

         <?php endwhile; ?>     <?php else: ?>
             <?php _e('Sorry, no page matched your criteria.', 'profile'); ?>
     <?php endif;                          $avia_config['size'] = avia_layout_class( 'main' , false) == 'entry_without_sidebar' ? '' : 'entry_with_sidebar';                         get_template_part( 'includes/loop', 'page' );                         ?>                                                                         <?php                          //get the sidebar                     $avia_config['currently_viewing'] = 'page';                     get_sidebar();                          ?>

                    <?php get_footer(); ?>      Is solved.


WP multisite network plugin fails to see classes loaded with spl autoload

I have a home-grown plugin that's a library of various classes/methods. Let's call it my_autoload. In WP single-site I've been using spl autoload to require() the classes as I have other plugins that use what's offered in the library. No problems**. I've tried to use my_autoload and a second plugin that uses the library in a WP multisite install. Let's call the second plugin uses_my_autoload. If the plugins are used as single site plugins, again no problems. However, if I tried to use the plugins (my_autoload + uses_my_autoload) as network plugins I get a white screen of death. I log when then the spl autoload does the require($file) and that seems fine. Again, this works fine in WP single site, or a single site within a MS network. However when uses_my_autoload tried to instantiate a class (spl autoloaded by) my_autoload I get: "PHP Fatal error: Class 'someClassFromMyAutoload' not found in /srv/www/comcastlmd.com/public_html/wp-content/plugins/pov-videos/pov- videos.php on line ###" It's as if in WP MS one plugin is "sandboxed" from the other. That the require() doesn't carry from on plugin to the next. What am I missing? What can I try? What might WP MS do (differently from single-site) that could effect spl autoload?? ** Note: I do account for plugin loading order and adjust (single site) option 'active_plugins' and (multisite) option 'active_sitewide_plugins'. So as far as I know it's no a loading order issue. That is, something else that uses the library runs before the library. The library plugin is set up to also be move to the top of the option(s) array and also be first.


Countdown to date function?

When a user signs up on my site they have to select a date as part of resignation. On their profile page I need to show a countdown to that date. Something simple like attached. How can I create this function? ![enter image description here](http://i.stack.imgur.com/F2Hhp.png)


Hierarchical Page Listing of all Pages in a Multisite Network

I would like to create a page template that does a listing of all pages across all blogs within a multisite network and list those pages starting with the blog name of the site and then list out the pages within that site. So far so good. This post got me 99% of the way there: How to list all network sites on one page The last part I need help with is sorting the output by blogname. I tried sorting by path, but that didn't seem to work. Here's what I have so far:               $blogs = $wpdb->get_results(     "SELECT blog_id,path FROM {$wpdb->blogs}     WHERE blog_id != {$wpdb->blogid}     AND site_id = '{$wpdb->siteid}'     AND spam = '0'     AND deleted = '0'     AND archived = '0'     order by blog_id", ARRAY_A     );     */          // get all blogs     $blogs = get_blog_list( 0, 'all' );          if ( 0 < count( $blogs ) ) :     foreach( $blogs as $blog ) :         switch_to_blog( $blog[ 'blog_id' ] );              if ( get_theme_mod( 'show_in_home', 'on' ) !== 'on' ) {             continue;         }              $description  = get_bloginfo( 'description' );         $blog_details = get_blog_details( $blog[ 'blog_id' ] );         ?>

                 <a href="<?php echo $blog_details->path ?>">                     <?php echo  $blog_details->blogname; ?>

             <?php               $args = array(                 'depth'        => 4,                 'child_of'     => '',                 'title_li'     => '',                 'echo'         => 1,                 'sort_column'  => 'menu_order, post_title',                 'post_type'    => 'page',                 'post_status'  => 'publish'               );             ?>             <?php wp_list_pages( $args ); ?>
     <?php endforeach;     endif; ?>


How to replace "Password Protected" text with icon in Admin

In Wordpress, whenever a post is password protected the backend admin area appends the text in bold "- Password protected" after the post title. What I am looking for is a way to remove this text and instead have it utilize an icon (link below) which should be appended before the title text. How can this be done? I want to use an Icon from the Aesthetica Icon Set by http://dryicons.com: ![alt text](http://i.stack.imgur.com/aIDa6.png)


The Essential WordPress Websites / Weblogs?

I am looking for **the** essential weblogs / references / sites to place in my bookmark collection / sidebar. Is it possible that add a) either a link to existing bookmark collections b) additional sites that need to be here?   * sorting will be done based on alexa ranking to make the sorting honest   * if a person works at automattic place that tag behind   * if he has a nickname / nickname on here / different site name place it behind it   * if he/she has a profile on here place it behind it ## People ![Jeff Star](http://www.google.com/s2/favicons?domain=perishablepress.com) Jeff Star perishablepress ![](http://www.alexa.com/favicon.ico) 110 ![Joost de Valk](http://www.google.com/s2/favicons?domain=yoast.com) Joost de Valk yoast ![](http://www.alexa.com/favicon.ico) 3,415 ![Vladimir Prelovac](http://www.google.com/s2/favicons?domain=www.prelovac.com) Vladimir Prelovac ![](http://www.alexa.com/favicon.ico) 5,683 ![Mark Ghosh](http://www.google.com/s2/favicons?domain=weblogtoolscollection.com) Mark Ghosh weblogtoolscollection ![](http://www.alexa.com/favicon.ico) 7,443 ![Lester Chan](http://www.google.com/s2/favicons?domain=lesterchan.net) Lester Chan ![](http://www.alexa.com/favicon.ico) 9,687 ![Jean-Baptise Jung 1](http://www.google.com/s2/favicons?domain=www.catswhocode.com) Jean-Baptise Jung 1 catswhocode ![](http://www.alexa.com/favicon.ico) 10,140 ![Lorelle VanFossen](http://www.google.com/s2/favicons?domain=lorelle.wordpress.com) Lorelle VanFossen ![](http://www.alexa.com/favicon.ico) 10,436 ![Kyle Eslick](http://www.google.com/s2/favicons?domain=wphacks.com) Kyle Eslick wphacks ![](http://www.alexa.com/favicon.ico) 10,712 ![Jean-Baptiste Jung 2](http://www.google.com/s2/favicons?domain=www.wprecipes.com) Jean-Baptiste Jung 2 wprecipes ![](http://www.alexa.com/favicon.ico) 12,653 ![Justin Tadlock](http://www.google.com/s2/favicons?domain=justintadlock.com) Justin Tadlock ![](http://www.alexa.com/favicon.ico) 12,778 ![Arne Brachhold](http://www.google.com/s2/favicons?domain=www.arnebrachhold.de) Arne Brachhold ![](http://www.alexa.com/favicon.ico) 16,058 ![Matt Mullenweg](http://www.google.com/s2/favicons?domain=ma.tt) Matt Mullenweg Automattic ![](http://www.alexa.com/favicon.ico) 17,489 ![Frank Bültge](http://www.google.com/s2/favicons?domain=bueltge.de) Frank Bültge ![bueltge](http://sstatic.net/wordpress/img/favicon.ico) bueltge ![](http://www.alexa.com/favicon.ico) 18,969 ![John Godley](http://www.google.com/s2/favicons?domain=urbangiraffe.com) John Godley Automattic, CodeWrangler ![](http://www.alexa.com/favicon.ico) 22,435 ![Alex King ](http://www.google.com/s2/favicons?domain=alexking.org) Alex King ![](http://www.alexa.com/favicon.ico) 23,233 ![Denis de Bernardy](http://www.google.com/s2/favicons?domain=www.semiologic.com) Denis de Bernardy ![denis](http://sstatic.net/wordpress/img/favicon.ico) denis ![](http://www.alexa.com/favicon.ico) 26,923 ![Alex.Rabe](http://www.google.com/s2/favicons?domain=alexrabe.de) Alex.Rabe ![](http://www.alexa.com/favicon.ico) 26,929 ![Donncha O Caoimh](http://www.google.com/s2/favicons?domain=ocaoimh.ie) Donncha O Caoimh Automattic ![](http://www.alexa.com/favicon.ico) 30,118 ![Otto on WordPress](http://www.google.com/s2/favicons?domain=ottopress.com) Otto on WordPress ![](http://www.alexa.com/favicon.ico) 31,446 ![Ozh](http://www.google.com/s2/favicons?domain=planetozh.com) Ozh ![](http://www.alexa.com/favicon.ico) 34,607 ![Mark Jaquith](http://www.google.com/s2/favicons?domain=markjaquith.wordpress.com) Mark Jaquith ![](http://www.alexa.com/favicon.ico) 40,206 ![Janis Elsts](http://www.google.com/s2/favicons?domain=w-shadow.com) Janis Elsts ![](http://www.alexa.com/favicon.ico) 40,836 ![Ben Gillbanks](http://www.google.com/s2/favicons?domain=www.binarymoon.co.uk) Ben Gillbanks ![](http://www.alexa.com/favicon.ico) 41,124 ![Michael Wohrer](http://www.google.com/s2/favicons?domain=sw-guide.de) Michael Wohrer ![](http://www.alexa.com/favicon.ico) 47,352 ![Peter Westwood](http://www.google.com/s2/favicons?domain=blog.ftwr.co.uk) Peter Westwood Automattic ![](http://www.alexa.com/favicon.ico) 59,592 ![Roy Tanck](http://www.google.com/s2/favicons?domain=www.roytanck.com) Roy Tanck ![](http://www.alexa.com/favicon.ico) 50,660 ![Konstantin kovshenin](http://www.google.com/s2/favicons?domain=kovshenin.com) Konstantin kovshenin ![](http://www.alexa.com/favicon.ico) 51,739 ![Mike Jolley](http://www.google.com/s2/favicons?domain=blue-anvil.com) Mike Jolley blue-anvil ![](http://www.alexa.com/favicon.ico) 58,573 ![Austin Matzko](http://www.google.com/s2/favicons?domain=austinmatzko.com) Austin Matzko 58,518 ![Alex Denning](http://www.google.com/s2/favicons?domain=wpshout.com) Alex Denning ![](http://www.alexa.com/favicon.ico) 61,879 ![Alex Mills](http://www.google.com/s2/favicons?domain=www.viper007bond.com) Alex Mills ![viper007bond](http://sstatic.net/wordpress/img/favicon.ico) viper007bond Automattic ![](http://www.alexa.com/favicon.ico) 68,506 ![Milan Petrovic](http://www.google.com/s2/favicons?domain=www.dev4press.com) Milan Petrovic dev4press ![](http://www.alexa.com/favicon.ico) 68,973 ![Andrea Rennick](http://www.google.com/s2/favicons?domain=wpmututorials.com) Andrea Rennick wpmututorials.com ![](http://www.alexa.com/favicon.ico) 77,103 ![Dougal Campbell](http://www.google.com/s2/favicons?domain=dougal.gunters.org) Dougal Campbell ![](http://www.alexa.com/favicon.ico)108,573 ![Ronald Heft](http://www.google.com/s2/favicons?domain=ronaldheft.com) Ronald Heft ![Matthew Robinson](http://www.google.com/s2/favicons?domain=subscribe2.wordpress.com) Matthew Robinson subscribe2 ![Scribu](http://www.google.com/s2/favicons?domain=scribu.net) Scribu ![scribu](http://sstatic.net/wordpress/img/favicon.ico) scribu ![](http://www.alexa.com/favicon.ico) 114,481 ![#00101783#Takayuki Miyoshi](http://www.google.com/s2/favicons?domain=ideasilo.wordpress.com) #00101783#Takayuki Miyoshi ![Mike Challis](http://www.google.com/s2/favicons?domain=www.642weather.com) Mike Challis ![Andrew Charlton](http://www.google.com/s2/favicons?domain=geekyweekly.com) Andrew Charlton ![Thomas Scholz](http://www.google.com/s2/favicons?domain=toscho.de) Thomas Scholz ![toscho](http://sstatic.net/wordpress/img/favicon.ico) toscho ![Joseph Scott](http://www.google.com/s2/favicons?domain=josephscott.org) Joseph Scott ![Martin Fitzpatrick](http://www.google.com/s2/favicons?domain=www.mutube.com) Martin Fitzpatrick ![Andrey Savchenko](http://www.google.com/s2/favicons?domain=www.rarst.net) Andrey Savchenko ![rarst](http://sstatic.net/wordpress/img/favicon.ico) rarst ![Aumaury Balmer](http://www.google.com/s2/favicons?domain=www.herewithme.fr) Aumaury Balmer ![Hakre](http://www.google.com/s2/favicons?domain=hakre.wordpress.com) Hakre ![hakre](http://sstatic.net/wordpress/img/favicon.ico) hakre ![Jonathan Brinley](http://www.google.com/s2/favicons?domain=xplus3.net) Jonathan Brinley ![Pete Mall](http://www.google.com/s2/favicons?domain=developersmind.com) Pete Mall developersmind ![Andrew Nacin](http://www.google.com/s2/favicons?domain=andrewnacin.com) Andrew Nacin ![Michael Torbert](http://www.google.com/s2/favicons?domain=michaeltorbert.com) Michael Torbert ![Michael Adams](http://www.google.com/s2/favicons?domain=blogwaffe.com) Michael Adams Automattic ![Mike Schinkel](http://www.google.com/s2/favicons?domain=mikeschinkel.com) Mike Schinkel ![mikeschinkel](http://sstatic.net/wordpress/img/favicon.ico) mikeschinkel ![Dion Hulse](http://www.google.com/s2/favicons?domain=dd32.id.au) Dion Hulse ![Weston Deboer](http://www.google.com/s2/favicons?domain=tipsforwordpress.com) Weston Deboer ![Remkus de Vries](http://www.google.com/s2/favicons?domain=www.forsite.nu) Remkus de Vries ![Barry Abrahamson](http://www.google.com/s2/favicons?domain=barry.wordpress.com) Barry Abrahamson Automattic ![Robert Chapin](http://www.google.com/s2/favicons?domain=www.miqrogroove.com) Robert Chapin ![Chris Olbekson](http://www.google.com/s2/favicons?domain=c3mdigital.com) Chris Olbekson ![chris-o](http://sstatic.net/wordpress/img/favicon.ico) chris-o ![Andrew Ozz](http://www.google.com/s2/favicons?domain=azaozz.wordpress.com) Andrew Ozz Automattic ![Adam Backstrom](http://www.google.com/s2/favicons?domain=sixohthree.com) Adam Backstrom ![adam-backstrom](http://sstatic.net/wordpress/img/favicon.ico) adam-backstrom ![Eric Mann](http://www.google.com/s2/favicons?domain=mindsharestrategy.com) Eric Mann ![eamann](http://sstatic.net/wordpress/img/favicon.ico) eamann ![Michael Koenig](http://www.google.com/s2/favicons?domain=mkoenig.wordpress.com) Michael Koenig ![](http://www.alexa.com/favicon.ico) 25,250,00 ![Ulrich SOSSOU](http://www.google.com/s2/favicons?domain=ulrichsossou.com) Ulrich SOSSOU ![sorich87](http://sstatic.net/wordpress/img/favicon.ico) sorich87 ![Jon Bloch](http://www.google.com/s2/favicons?domain=www.avendimedia.com) Jon Bloch ![john-p-bloch](http://sstatic.net/wordpress/img/favicon.ico) john-p- bloch ![Jan Fabry](http://www.google.com/s2/favicons?domain=www.monkeyman.be) Jan Fabry ![jan-fabry](http://sstatic.net/wordpress/img/favicon.ico) jan-fabry ![Travis Northcutt](http://www.google.com/s2/favicons?domain=travisnorthcutt.com) Travis Northcutt ![tnorthcutt](http://sstatic.net/wordpress/img/favicon.ico) tnorthcutt ![Nathaniel Taintor](http://www.google.com/s2/favicons?domain=goldenapplesdesign.com) Nathaniel Taintor ![goldenapples](http://sstatic.net/wordpress/img/favicon.ico) goldenapples ## Handy Weblogs and Aggregators ![WordPress Planet](http://www.google.com/s2/favicons?domain=planet.wordpress.org) WordPress Planet ![WordPress Vote \(BG\)](http://www.google.com/s2/favicons?domain=wpvote.com) WordPress Vote (BG) ![Workflow- WordPress](http://www.google.com/s2/favicons?domain=workflowwp.com) Workflow- WordPress ## Team Wp Blogs ![Brian Clark](http://www.google.com/s2/favicons?domain=www.copyblogger.com) Brian Clark ![Harsh Agrawal](http://www.google.com/s2/favicons?domain=www.shoutmeloud.com) Harsh Agrawal ![Digging in WordPress](http://www.google.com/s2/favicons?domain=digwp.com) Digging in WordPress ![Jeff Chandler](http://www.google.com/s2/favicons?domain=www.talkshoe.com) Jeff Chandler ![WPCandy](http://www.google.com/s2/favicons?domain=wpcandy.com) WPCandy ![WP Engineer](http://www.google.com/s2/favicons?domain=wpengineer.com) WP Engineer ![WordPress - blueblots.com](http://www.google.com/s2/favicons?domain=blueblots.com) WordPress - blueblots.com ![WordPress Publisher Blog](http://www.google.com/s2/favicons?domain=publisherblog.automattic.com) WordPress Publisher Blog ## wordpress.org ![WordPress.org](http://www.google.com/s2/favicons?domain=wordpress.org) WordPress.org ![Blog](http://www.google.com/s2/favicons?domain=wordpress.org) Blog ![Codex](http://www.google.com/s2/favicons?domain=codex.wordpress.org) Codex ![Download](http://www.google.com/s2/favicons?domain=wordpress.org) Download ![Function Reference](http://www.google.com/s2/favicons?domain=codex.wordpress.org) Function Reference ![Showcase](http://www.google.com/s2/favicons?domain=wordpress.org) Showcase ![Trac](http://www.google.com/s2/favicons?domain=core.trac.wordpress.org) Trac ![development updates](http://www.google.com/s2/favicons?domain=wpdevel.wordpress.com) development updates ## Automattic ![Blog](http://www.google.com/s2/favicons?domain=automattic.com) Blog ![WordPress.com](http://www.google.com/s2/favicons?domain=wp.com) WordPress.com ![WordPress.org](http://www.google.com/s2/favicons?domain=wordpress.org) WordPress.org ![Akismet](http://www.google.com/s2/favicons?domain=akismet.com) Akismet ![bbPress](http://www.google.com/s2/favicons?domain=bbpress.org) bbPress ![Gravatar](http://www.google.com/s2/favicons?domain=gravatar.com) Gravatar ![BuddyPress](http://www.google.com/s2/favicons?domain=buddypress.org) BuddyPress ![After the Deadline](http://www.google.com/s2/favicons?domain=afterthedeadline.com) After the Deadline ![GlotPress](http://www.google.com/s2/favicons?domain=glotpress.org) GlotPress ![IntenseDebate](http://www.google.com/s2/favicons?domain=intensedebate.com) IntenseDebate ![P2](http://www.google.com/s2/favicons?domain=p2theme.com) P2 ![Ping-O-Matic](http://www.google.com/s2/favicons?domain=pingomatic.com) Ping- O-Matic ![Plinky](http://www.google.com/s2/favicons?domain=plinky.com) Plinky ![PollDaddy](http://www.google.com/s2/favicons?domain=polldaddy.com) PollDaddy ![VIP](http://www.google.com/s2/favicons?domain=vip.wordpress.com) VIP ![VaultPress](http://www.google.com/s2/favicons?domain=vaultpress.com) VaultPress ![VideoPress](http://www.google.com/s2/favicons?domain=videopress.com) VideoPress ![WP for Android](http://www.google.com/s2/favicons?domain=android.wordpress.org) WP for Android ![WP for Blackberry](http://www.google.com/s2/favicons?domain=blackberry.wordpress.org) WP for Blackberry ![WP for iPhone](http://www.google.com/s2/favicons?domain=iphone.wordpress.org) WP for iPhone ![WordCamp SF](http://www.google.com/s2/favicons?domain=2010.sf.wordcamp.org) WordCamp SF ![WordPress.tv](http://www.google.com/s2/favicons?domain=wordpress.tv) WordPress.tv ![WordPress Foundation](http://www.google.com/s2/favicons?domain=wordpressfoundation.org) WordPress Foundation ![WordPress apps](http://www.google.com/s2/favicons?domain=en.support.wordpress.com) WordPress apps ## forums, lists and help ![WP org forum](http://www.google.com/s2/favicons?domain=wordpress.org) WP org forum ![Ideas forum](http://www.google.com/s2/favicons?domain=wordpress.org) Ideas forum ![WP Tavern Forum](http://www.google.com/s2/favicons?domain=www.wptavern.com) WP Tavern Forum ![WordPress - Stack Exchange](http://www.google.com/s2/favicons?domain=wordpress.stackexchange.com) WordPress - Stack Exchange ![WordPress Int Forums](http://www.google.com/s2/favicons?domain=nl.forums.wordpress.org) WordPress Int Forums ![wp-hackers list](http://www.google.com/s2/favicons?domain=comox.textdrive.com) wp-hackers list ## themes ![Wp Org Themes](http://www.google.com/s2/favicons?domain=wordpress.org) Wp Org Themes ![SiteGround.com](http://www.google.com/s2/favicons?domain=forum.siteground.com) SiteGround.com ![wptemplates](http://www.google.com/s2/favicons?domain=wptemplates.org) wptemplates ## tools ![Wordpress Theme Generator - Create your own Wordpress Theme.](http://www.google.com/s2/favicons?domain=www.yvoschaap.com) Wordpress Theme Generator - Create your own Wordpress Theme. ## plugins ![Wp Org Plugins](http://www.google.com/s2/favicons?domain=wordpress.org) Wp Org Plugins ![Top 1000](http://www.google.com/s2/favicons?domain=w-shadow.com) Top 1000 ![WordPress Plugin Guide](http://www.google.com/s2/favicons?domain=wordpresspluginguide.com) WordPress Plugin Guide ## Cheat Sheets ![all tags](http://www.google.com/s2/favicons?domain=ranjith.zfs.in) all tags ![templates and tags](http://www.google.com/s2/favicons?domain=www.hpvorlagen24.de) templates and tags ## jobs ![WordPress Jobs](http://www.google.com/s2/favicons?domain=jobs.wordpress.net)jobs.wordpress.net ![Wordpress Jobs for Freelancers - Employment, Part Time Jobs & Freelance Jobs](http://www.google.com/s2/favicons?domain=www.freelancer.com) Wordpress Jobs for Freelancers - Employment, Part Time Jobs & Freelance Jobs ## Automattic employees ![Nikolay Bachiyski](http://www.google.com/s2/favicons?domain=nikolay.bg) Nikolay Bachiyski ![Raanan Bar-Cohen](http://www.google.com/s2/favicons?domain=raanan.com) Raanan Bar-Cohen ![Sheri Bigelow](http://www.google.com/s2/favicons?domain=designsimply.com) Sheri Bigelow ![Ryan Boren](http://www.google.com/s2/favicons?domain=boren.nu) Ryan Boren ![Anthony Bubel](http://www.google.com/s2/favicons?domain=anthonybubel.com) Anthony Bubel ![Lloyd Budd](http://www.google.com/s2/favicons?domain=foolswisdom.com) Lloyd Budd ![Kevin Conboy](http://www.google.com/s2/favicons?domain=www.alternate.org) Kevin Conboy ![Stephane Daury](http://www.google.com/s2/favicons?domain=stephdau.wordpress.com) Stephane Daury ![Yoav Farhi](http://www.google.com/s2/favicons?domain=blog.yoavfarhi.com) Yoav Farhi ![Ze Fountainhas](http://www.google.com/s2/favicons?domain=everywhereelse.wordpress.com) Ze Fountainhas ![Jon Fox](http://www.google.com/s2/favicons?domain=jonefox.com) Jon Fox ![Eoin Gallagher](http://www.google.com/s2/favicons?domain=magp.ie) Eoin Gallagher ![John Godley](http://www.google.com/s2/favicons?domain=urbangiraffe.com) John Godley ![Noel Jackson](http://www.google.com/s2/favicons?domain=noel.io) Noel Jackson ![Demitrious Kelly](http://www.google.com/s2/favicons?domain=blog.apokalyptik.com) Demitrious Kelly ![Isaac Keyet](http://www.google.com/s2/favicons?domain=www.isaackeyet.com) Isaac Keyet ![Paul Kim](http://www.google.com/s2/favicons?domain=blog.numenity.org) Paul Kim ![Beau Lebens](http://www.google.com/s2/favicons?domain=dentedreality.com.au) Beau Lebens ![David Lenehan](http://www.google.com/s2/favicons?domain=blog.polldaddy.com) David Lenehan ![Ryan Markel](http://www.google.com/s2/favicons?domain=ryanmarkel.com) Ryan Markel ![Naoko McCracken](http://www.google.com/s2/favicons?domain=blog.detlog.org) Naoko McCracken ![Nick Momrik](http://www.google.com/s2/favicons?domain=nickmomrik.com) Nick Momrik ![Raphael Mudge](http://www.google.com/s2/favicons?domain=blog.afterthedeadline.com) Raphael Mudge ![Thorsten Ott](http://www.google.com/s2/favicons?domain=blog.webzappr.com) Thorsten Ott ![Andy Pealing](http://www.google.com/s2/favicons?domain=apeatling.wordpress.com) Andy Pealing ![Michael Pick](http://www.google.com/s2/favicons?domain=michaelpick.wordpress.com) Michael Pick ![Mark Riley](http://www.google.com/s2/favicons?domain=romanticrobot.net) Mark Riley ![Hanni Ross](http://www.google.com/s2/favicons?domain=hanni.me) Hanni Ross ![Sara Rosso](http://www.google.com/s2/favicons?domain=www.whenihavetime.com) Sara Rosso ![Dan RoundHill](http://www.google.com/s2/favicons?domain=danroundhill.com) Dan RoundHill ![Toni Schneider](http://www.google.com/s2/favicons?domain=toni.org) Toni Schneider ![Joseph Scott](http://www.google.com/s2/favicons?domain=josephscott.org) Joseph Scott ![Alex Shiels](http://www.google.com/s2/favicons?domain=thresholdstate.com) Alex Shiels ![Andy Skelton](http://www.google.com/s2/favicons?domain=andy.wordpress.com) Andy Skelton ![Ian Stewart](http://www.google.com/s2/favicons?domain=themeshaper.com) Ian Stewart ![Hew Sutton](http://www.google.com/s2/favicons?domain=burningcubicle.com) Hew Sutton ![Noriyko Tate](http://www.google.com/s2/favicons?domain=noshe.wordpress.com) Noriyko Tate ![Matt Thomas](http://www.google.com/s2/favicons?domain=iammattthomas.com) Matt Thomas ![Joy Victory](http://www.google.com/s2/favicons?domain=editor.wordpress.com) Joy Victory ![Jane Welss](http://www.google.com/s2/favicons?domain=jane.wordpress.com) Jane Welss ![Lance Willet](http://www.google.com/s2/favicons?domain=simpledream.net) Lance Willet ## Reference ![PHPXref](http://www.google.com/s2/favicons?domain=phpxref.ftwr.co.uk) PHPXref ![WordPress  API doc](http://www.google.com/s2/favicons?domain=www.tig12.net) WordPress API doc


Where to find new class reference or function of deprecated one?

After upgrading from WordPress 3.5.2 to 3.6.1, with `define('WP_DEBUG', true);` a site of mine's showing warning for some deprecated codes throughout the site. Some of 'em are generated from my codes, and some of 'em are from plugins I'm using. In some of the messages, the debug process shows me what function to use instead, but in some cases, it's not. So, it becomes difficult for me to find a new code that replaces the deprecated one. **Note:** I'm a Wikipedian, and a Codex editor also.   Suppose, in Codex we can find all the deprecated codes here in this category. Some of them are well cited, with the new codes that replaces the deprecated one, but some of 'em are not, i.e.: this one (as on this revision). With this scenario, we know that some of the functions are replaced with another functions, while some other functions are replaced by a parameter of another different function. So, it's a bit unpredictable _which one can be used instead on this one_. In this scenario, I think we need to find a place where we can sort all the deprecated functions with their new solutions, in a list. If such a thing is not available just now, we can make a separate page in Codex. ### Edit I may not clear with the motive of the question, I want a list like below:               +===========================+==============================+     |       DEPRECATED CODE     |            NEW CODE          |     +===========================+==============================+     |       `get_usermeta`      |         `get_user_meta`      |     | `register sidebar widget` | `wp_register_sidebar_widget` |     |            ...            |              ...             |     +===========================+==============================+


custom taxonomy and pages rewrite slug conflict gives 404

I'm using the Custom Post Type UI plugin to create my custom taxonomies. I have a portfolio that is made up of projects (custom post type) with 2 custom taxonomies of technologies and clients. The clients taxonomy has a custom rewrite slug of `portfolio/clients/`, while the technologies taxonomy has a custom rewrite slug of `portfolio/` Rewrites:   `portfolio/html` <- page displays all projects using HTML   `portfolio/clients/client-a` <- page displays all projects for client A Now when I try to make a landing page for clients that has a url slug of `/portfolio/clients` I get the 404 page. I'm pretty sure this is because of conflicting url rewrites of the technologies taxonomy. I'm guessing as it searches for it in the technology taxonomy, it doesn't exist then it spits out the 404 page. So how do I get the url rewrite slug to work so that when I hit `/portfolio/clients`, it doesn't send back the 404 page and it uses the correct page template?


How to limit characters in Academica featured posts widget?

I'm currently using the featured posts sidebar widget in the Academica wordpress theme. I'd like to know if there's a way to limit the number of characters displayed in the excerpt without resorting to installing yet another plugin with this functionality. Looks like the code for this function of the widget is as follows.               if ( empty( $sidebars['sidebar-2'] ) ) {         $widget = get_option( 'widget_academica-featured-posts-gallery', array( '_multiwidget' => 1 ) );         $widget[2] = array(             'title' => __( 'Latest Posts', 'academica' ),             'category' => 0,             'display' => 'list',             'amount' => 4,


How to Get All Taxonomies AND All Terms For Each Taxonomy With Post Count Zero

Is there an easy way of obtaining every registered taxonomy and for each registered taxonomy, get all the terms for that taxonomy, and for each term, get the post count, without actually fetching all of the post data? I would assume it is most definitely possible. I would also assume it requires some massively long database query using `$wpdb`.


Alter secondary loop to exclude posts from current page category

The below code is taken from sidebar.php where it outputs random posts from multiple categories and excludes the current post from showing up. This works great but how do I alter this loop to exclude all posts from the current pages category? So for example if a post is currently on display and its category is artists, I'd like to exclude all artists posts from being displayed but display all the other categories (stated in the code below). This is my loop:               <?php             // First, let's eliminate some DRY,             // by making an array of our categories             $random_posts_cat_array = array( 'artists', 'projects', 'people', 'development', 'offsite' );                  // Globalize $post,             // since we're outside the primary loop             global $post;             $post_cats = get_the_category( $post->ID );             // First array object             $post_cat = $post_cats[0];             // Current post category ID             $post_cat_id = $post_cat->term_id;             // Current post category slug             $post_cat_slug = $post_cat->slug;                  // Now, let's find out if we're displaying             // the category index for one of our categories             if ( in_array( $post_cat_slug, $random_posts_cat_array ) ) {                      // Set up custom loop args                 $random_posts_query_args = array(                     'posts_per_page' => 3,                     'orderby'       => 'rand',                     'post__not_in'  => array( $post->ID )                 );                 // Add Cat ID to custom loop args                 foreach ( $random_posts_cat_array as $random_post_cat ) {                     if ( $post_cat_slug == $random_post_cat ) {                         // Add Cat ID                         $random_posts_query_args['cat'] = $post_cat_id;                      }                 }                      // Run random posts query                 $random_posts_query = new WP_Query( $random_posts_query_args );                      // Setup random posts query loop                 if ( $random_posts_query->have_posts() ) : while ( $random_posts_query->have_posts() ) : $random_posts_query->the_post();?>                              <?php foreach( get_the_category() as $cat ) echo '
slug . '" data-category="' . $cat->slug . '" >'; ?>                                    <a href="<?php the_permalink()?>" title="<?php the_title(); ?>">

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

                     <?php endwhile; endif;                      // Be kind; rewind                 wp_reset_postdata();                  } else { // display nothing ?>                       <?php }?>


wp_insert_posts add title with count of posts plus one

I'm trying to create posts where title will be `1`, `2` etc,               $published_posts = wp_count_posts('orders')->publish;     $count = $published_posts + $a;          $success = get_page_link(794);          if(wp_mail($admin_email, 'Заказ с сайта: '.get_bloginfo('name'), $message)) {         $my_post = array(                 'post_title'    => $count,                 'post_type'     => 'orders',                 'post_content'  => $message,                 'post_status'   => 'publish',                 'post_author'   => 1,             );         $post_id = wp_insert_post( $my_post );      but the title of post anywhere is `1-2`, `1-3` etc. How can I count posts and add post plus 1? For example, if the post is `10`, the name of new post will be `11`


How to remove bullets from widget

I created a custom theme for my wordpress blog, and my widgets keep showing up in an unordered list form. I didn't program my widgets to appear this way. And I can't figure out how to remove the bullets from my widgets. I tried editing the widgets.php file in the wp-includes folder by removing the beforewiget and afterwidget parameters but that doesn't seem to do the trick. I took a look at my source code and this is what's wrapped around the widgets.

Categories

Big Notch Updates (20)

Music News (50)

Ramblings (43)

Site News (14)

Stuff I Like (25)

      So it looks like "catorgories 3" is what is making this a list. Is this something that is set in the wordpress files? can I modify it and set list- style to "none" through my theme css?


New Admin Bar Not Functioning

With WP 3.1, as we all know, the admin bar is a new feature on your blog when you are logged in as an administrator, but for some reason on my theme, the admin bar is not there. In it's place is a grey bar about 30 pixels tall (matching my pages background color). What could be hiding it? If it's useful, the theme is at wphax.com


Custom query to show posts

I am trying to sort posts based on rating (using wp-postrating plugin) and numbers of comments. I have made this using wpdb, but i kinda wish to make it easier and use it with wp_query. Seems that I can not find any way to achieve this because I do not know any method to orderby two items in $args. My wpdb code looks like this... `$wpdb->get_results("SELECT wp_postmeta.meta_value, id, post_title, comment_count FROM wp_posts INNER JOIN wp_postmeta ON wp_postmeta.post_id = wp_posts.id WHERE post_type='post' AND wp_postmeta.meta_key='ratings_average' ORDER BY wp_postmeta.meta_value DESC, comment_count DESC");` Any idea?


How can I filter by slug depending on language selection

I'm new to this site but looking at the quality of answers provided here I will be here for a long time :) Ok, first a bit of info: I'm developing a bilingual website (English & Japanese) using Wordpress and the WPML Multi-lingual CMS. The site is for a cafe in Tokyo, Japan. All the products names and descriptions have been written in English and translated into Japanese. Doing so, using WPML, produces 2 identical products, 1 in English and 1 in Japanese. The slugs are named after the product name, so for example the product "Caramel Cappuccino" has the slug "caramel-cappuccino". And, the corresponding Japanese version has the slug "caramel-cappuccino-ja". This is the same for all products in both languages with all the Japanese version products getting -ja at the end. Now comes my problem: There is a template, that was included by the author of the theme, that produces a Menu like you would see in a restaurant. The problem is that the menu displays all of the products in both languages regardless of whether English or Japanese has been selected as the language of the site by the user. So, if you check the links below, you will see that all the products are displayed twice. You can see the current situation here: English: http://www.oasis-radio.net/mobile/wordpress/menu/ Japanese: http://www.oasis-radio.net/mobile/wordpress/ja/menu-ja/ What I want to do: I want to create some kind of loop, where if the the language selection is English, only the English versions of the products are displayed and likewise, if the language selection is Japanese, only the Japanese versions of the products are displayed. I've tried a few different things but can't seem to get anything to work. This is the php code for the template that produces the Menu page:                   <?php     /**      *      * A custom page template without sidebar, full width.      *      * @package WordPress      * @subpackage Ermark Adora      *      */              get_header();              echo '
';             if (get_option('ermad_products_menu_of_the_day', 'false')=='true') {                 echo '
';                    }                       if ( have_posts() ) while ( have_posts() ) : the_post();                       if ( is_front_page() ) {                          echo '
'.get_the_title().'
';                      } else {                          echo '
'.get_the_title().'
';                      }                           the_content();                          wp_link_pages( array( 'before' => '
' . __( 'Pages:', 'adora' ), 'after' => '
' ) );                          edit_post_link( __( 'Edit', 'adora' ), '', '' );                 endwhile;                       if (get_option('ermad_products_menu_of_the_day', 'false')=='true') {                 echo '
';                 echo '
';                     echo '
'.get_option('ermad_products_menu_description', 'Go to admin panel to edit this description, you must add text for two lines for shure.').'
';                     loadProductsInOffer();                 echo '
';             }              echo '
';              ?>

                      <?php  loadProductsCateg(); ?>

          <?php           get_footer(); ?>      Any help would be greatly appreciated! Dan


Showing Custom Content in a Nav  Dropdown

I have a custom content type "balloons", and I've assigned a parent category to a "balloon" item, "Water Balloon" I've made the Balloon category a primary menu item. I want a link to "Water Balloon" to show in the dropdown, as it would if it was a page. I don't know how to do this, or if it's possible. Any ideas? Thanks in advance.


How to use get_template_directory_uri() to load an image that is in a sub-folder of my theme?

I am pretty new in WordPress and I have the following doubt about how to insert in my homepage an immage that is in a subfolder into my theme directory. So I have the following situation: Into my custom theme directory I have the following folder that contains a jpg immage: **/assets/img/flexslider/flex-1.jpg** Now in my **header.php** file I have something like this:

                    Lorem ipsum
                    sit dolor
                    adipiscing elitur

      Obviously, when I load the page, the immage **flex-1.jpg** is not loaded because there is not the right path (infact using FireBug I obtain that it try to load the **assets/img/flexslider/flex-1.jpg** immage) so I think that I could use the absolute path but this is pretty orrible !!! So I am thinking to use the **get_template_directory_uri()** function provided from WP to do this and I have try to change the previous code in this way:
            <img src=<?php get_template_directory_uri().'/assets/img/flexslider/flex-1.jpg' ?>>

                    Lorem ipsum
                    sit dolor
                    adipiscing elitur

      But don't work and using **FireBug** I can see that load nothing, infact in my brower source code I have:                     Why don't work? What am I missing? Tnx Andrea


Add feed to a custom page

I have searched and found a lot of people asking about how to add a custom rss feed for custom post types/taxonomies. However that's not the problem right now. I have 2 extra pages on my site that looks like the default index page (with loop and stuff), the only difference is that they have a different orderby. And I want a feed for those pages too. Putting /feed behind those pages returns a Comments feed with no items. How come? The code of those pages are almost identical to index.php and the feed link works fine there. I understand there's a add_feed function. But I don't want a new feed type, just the default one is fine.


Display Video as Post Thumbnail

I use the Nova free theme, from the Theme in Progress studio. I would like to display a video like a thumbnail image, as shown in this theme http://themeinprogress.com/demo/sueva/ How can I do this? I installed a plugin called Video Thumbnails, but didn't work.


Wordpress 4.0 Forces entire site into SSL

I updated to Wordpress 4.0 last night and this morning I noticed something strange. when I go to my site at www.mysiteurl.com it automatically goes to HTTPS. Before the update, if I went to www.mysiteurl.com it kept it at HTTP which is the way I would like it to stay. I read that Wordpress 4.0 makes some updates to how Wordpress handles SSL. The thing is, I found out about this happening, by using the Facebook Open Graph Object Debugger. These are the errors it gave me:               Circular Redirect Path  Circular redirect path detected (see 'Redirect Path' section for details).     Could Not Follow Redirect   URL requested a HTTP redirect, but it could not be followed.          To find the object, these are the redirects we had to follow     original    http://www.mysiteurl.com/     301 https://www.mysiteurl.com/     og:url  http://www.mysiteurl.com/      Does anybody know how I can fix this?


Why would Numeric permalinks work, but %postname% won't?

[Question edited as I discovered more] I have a weird problem, in that my permalinks do not work. Well actually, it works when the permalink-structure is set to something which begins with static text. (`/archive/%postname%` for instance). This would be fine if the site was only consistent of pages, which still gets their proper name, but it isn't. All blog entries are thus `/archive/<postname>` and Press Releases which is a custom post type, becomes `/archive/press-releases/<postname>` which doesn't fit my needs.   * ~~I know it's not the theme because it works just fine on both localhost and on another dev-server, which are both exact copies of the soon-to-be live domain (which is why I can't give out the URL).~~ I no longer am sure it's not the theme. Can't for the life of me figure out what it could be. If anyone can think of which piece(s) of code to use for diagnosis, I'll copy/paste whatever I need to.   * I know it's not Plugins either because I've tried disabling them all. No luck.   * I know it's not the .htaccess because it is also a duplicate of what's on the other servers, and I even tried removing it completely and had WP re-write it. Also, what I'm getting is the WP 404, not the Apache 404. Thankful for any ideas on what the problem might be. **Edit:**   I have now moved the site to a completely new WP install in a different hosting environment. The problem persists. This simply does not make any sense to me. I now think that something _is_ in fact wrong with the theme, but it still works on localhost _and_ on a separate dev-server. Could it really be that two completely separate hosting environment have the same weird problem? **Edit 2:**   I'm no longer expecting a solution, I'm merely adding this info in case someone else has similar problems and want to resurrect the questioning at a later date. What I've done now, is to first enable the default twentythirteen theme and the set the permalink structure to `/%category%/%postname%/`. I didn't expect it to work - but it did! I then figured it was the theme I've coded. But, not so sure. As I re-enabled the theme I'm going to use and reloaded the page, the permalinks still work! If I now go and fiddle with the permalinks however, it fails again. I've given up trying to find a reason for this odd behaviour. All the info above is still accurate. If someone wants to enlighten me, please do so :-)


how to apply Pagination on post

My English is bad so sorry for that ,I want to apply Pagination to my blog page ,I want to display 3 post on page then want to apply Pagination . thank you


How can i get featured image beside the menu item in main nav?

is there any way to get the featured image of the page beside the menu item in the main navigation of wordpress ? If we have featured image for the page, that should come beside the menu item otherwise a dummy image should display. If we are creating a custom link, that time also we need to display the dummy image beside that item. Is there any plugin or any code to do like this? Please suggest us on this. We will be waiting for your answer... Thank you


Responsive menu on genesis theme

Hi I'm customizing a Genesis framework theme Jane and I want to change the menu to be responsive with Twitter Bootstrap. I already found an question how to override the genesis_do_subnav function Using a filter to modify Genesis wp_nav_menu. I want to override that methode and generate the HTML shown below. The genesis sourcecode: genesis_do_subnav() which generates the HTML that is currently used. Customized Output:
         <button type="button" class="navbar-toggle" data-toggle="collapse"                 data-target="#bs-example-navbar-collapse-1">             Toggle navigation                                                </button>

                 Home

                 Home

                         Home

                         Home

           The current HTML that is generated by genesis_do_subnav() output:

                 Home

                 Home

                         Home

           Can anyone tell me how to add the extra div for the toggle button to expand/collapse the menu and how I can change
      to


Taxonomy drop down using post_name permalink

I'm using the following code to display my custom taxonomy as a drop down menu, all works fine except I need it to use the post_name permalink, just now it links to `?cat=2` etc. I've checked the codex and I can't see any arguments to change this unless I missed it. Code:

<?php _e('Posts by Tags'); ?>
     <form action="<?php bloginfo('url'); ?>/" method="get">
     <?php         $select = wp_dropdown_categories('taxonomy=mediums&show_option_none=Select    tag&show_count=1&orderby=name&echo=0');         $select = preg_replace("#<select([^>]*)>#", "<select$1 onchange='return this.form.submit()'>", $select);         echo $select;     ?>


Automatically add simple custom buttons for print, Facebook share, & Tweet in Posts

I want an easy way to **automatically** implement **printing** , **Facebook sharing** , and **Tweeting** for **posts**. **No plugins, complicated javascript, nor functions.**


WordPress Multi Site strange redirect on MAIN site

I am using a plugin which allows for multiple TLD's with WordPress multi-site. (WordPress MU Domain Mapping) No idea if this is a conflicting issue or not. Doubtfut, but thought I would throw it out there. Every now and then, when I visit the primary website which multi-site was installed on, I get redirected to a page: `http://www.primarydomain.com/wp- signup.php?new=primarydomain.com` Displaying the following text in a yellow box: > Greetings Site Administrator! You are currently allowing “none” > registrations. To change or disable registration go to your Options page. and a string of text beneath that: > Registration has been disabled. Although, I already added `define('NOBLOGREDIRECT', 'http://www.primarydomain.com/');` to `wp-config.php` Why is this happening?


Redirect an old link to new site homepage

I need to redirect a single link `www.abc.com/blog/?p=123` to `www.abc.com/newblog/` I have used:               RewriteRule ^blog/(.*)$ http://www.abc.com/newblog/ [R=301,L]      It is redirecting all sorts of links but missing links in the form `/?p=1236`.


Best option for photo/gallery handling?

Before I finally start blogging there's one last question that I need help with. My blog will be photo-focused. We're talking about 70-80% of photos compared to 20-30% of text. There might be some posts with up to 60 photos a ~200KB/file (~600px width). I might also provide a clickable link to a larger version of the photo (using Lightbox or just leading to an external image host gallery). My problem is that I don't yet quite fully understand what the best environment for a Wordpress blog is and thus I'm not sure if it's better to upload all the photos to my webhost, where also my Wordpress blog is hosted or if that's only slowing down the website and using an external image host, a CDN or whatever else is out there might be the better option? What's my best bet? As for image hosts, there are so many out there that it's difficult to choose from, so if that's a good way to do it, I'd be glad to hear some recommendations, especially those that will work well with Wordpress, of course. Thanks a lot in advance.


How to create default categories in new installs?

When a new user creates a new blog in WordPress MU I'd like to add a new category. How or where would I do this?


How do I reset this wp_list_categories query?

How do I reset a query that generates a list of categories with wp_list_categories? The query below builds a two column list of categories that is then displayed with the second code chunk. I'm using two of these queries (with different category include strings) in a jQuery tab to display different lists of categories. Problem is, the first query needs to be reset, because the second tab shows both lists of categories rather than categories from just the second query. I've tried `<?php wp_reset_query();?>` but that only works for the WP loop. Anyone have any ideas?                   <?php         $cats = explode         ("
",wp_list_categories('title_li=&echo=0&depth=1&style=none&include=12,13,14,15,16'));         $cat_n = count($cats) - 1;         for ($i=0;$i<$cat_n;$i++):         if ($i<$cat_n/2):         $cat_left = $cat_left.'
'.$cats[$i].'
';         elseif ($i>=$cat_n/2):         $cat_right = $cat_right.'
'.$cats[$i].'
';         endif; endfor; ?>
         <?php echo $cat_left;?>

         <?php echo $cat_right;?>


Downsize CPU & DB usage in wordpress

i have created a smart interface WP based which we use to manage clients..   it uses a lot of information and data each time a client is returned / viewed. **it is a locked interface and does not have traffic spikes** in the past month i have seen major memory and CPU usage spikes so,   i have installed the debug bar and opended all the options. What i am seeing is that each time wordpress includes wp-header-blog   and template-loader (or am i wrong?) - can i declare those once? **here is an example from the queries tab in the debug bar**               'clientsocialurls'     require('wp-blog-header.php'), require_once('wp-includes/template-loader.php'), include('/themes/sagive-manager/category.php'), include('/themes/sagive-manager/tabs/tab-siteinfo.php'), get_page_by_title #47 (14.4ms)     SELECT ID FROM armnd_posts WHERE post_title = 'זמנהוף שירותי תרגום' AND post_type= 'cheques'          require('wp-blog-header.php'), require_once('wp-includes/template-loader.php'), include('/themes/sagive-manager/category.php'), include('/themes/sagive-manager/tabs/tab-cheques.php'), get_page_by_title #48 (3.9ms)     SELECT armnd_posts.* FROM armnd_posts WHERE 1=1 AND armnd_posts.post_type = 'attachments' AND (armnd_posts.post_status = 'publish') ORDER BY armnd_posts.post_date ASC           require('wp-blog-header.php'), require_once('wp-includes/template-loader.php'), include('/themes/sagive-manager/category.php'), include('/themes/sagive-manager/tabs/tab-attachments.php'), get_posts, WP_Query->query, WP_Query->get_posts #49 (34.7ms)     SELECT post_id, meta_key, meta_value FROM armn_postmeta WHERE post_id IN (2073,2086,2093,2104,2109,2114,2119,2137,2143,2148,2154,2160,2165,2174,2178,2186,2274,2650,2708,3163,3356,3507,3644,3673,3893,3924,4039,4139,4286,4311,4515,4596,4666,4698,4722,4738,4740,4841,4860,4908,5219,5941,6086,6317) ORDER BY meta_id ASC          require('wp-blog-header.php'), require_once('wp-includes/template-loader.php'), include('/themes/sagive-manager/category.php'), include('/themes/sagive-manager/tabs/tab-attachments.php'), get_posts, WP_Query->query, WP_Query->get_posts, update_post_caches, update_postmeta_cache, update_meta_cache #50 (9.9ms)     SELECT armnd_posts.* FROM armnd_posts WHERE 1=1 AND armnd_posts.post_parent = 2119 AND armnd_posts.post_type = 'attachment' AND (armnd_posts.post_status = 'inherit') ORDER BY armnd_posts.post_date DESC           require('wp-blog-header.php'), require_once('wp-includes/template-loader.php'), include('/themes/sagive-manager/category.php'), include('/themes/sagive-manager/tabs/tab-attachments.php'), get_posts, WP_Query->query, WP_Query->get_posts      **does this means wordpress loads both files each time a query is called?**   can i "Declare" them once to minimize memory usage and load time? am i completlty missing the point and can you share some tips to downsize   the CPU usage & memory usage if its a given i cant use caching plugin.


settings api and the data passed in the parameter

in an example of the Settings API, there's an input and the callback function to sanitize/validate the result from this input : this is the input :               echo "<input id='text_string' name='boj_myplugin_options[text_string]' type='text' value='$text_string' />";      and this is the callback function :               function boj_myplugin_validate_options( $input ) {         $valid['text_string'] = preg_replace( '/[^a-zA-Z]/', '', $input['text_string'] );      i read that this function is passed the $_POST data as a parameter, but what does `text_string` stand for here : `$input['text_string']` ? i'm a bit confused, it should be the `name` parameter, but the name parameter seems to be a plain text : `name='boj_myplugin_options[text_string]'` Thanks for your answer


How do I call the dashboard's sortable javascript in a plugin page?

I want to create a multi-column sortable widget area in a plugin's settings page. In order to test this, I started by directly copying my dashboard's HTML content from `<div id="dashboard-widgets-wrap">` (including everything inside it). I got a nice rendering of my dashboard's widgets along with the auto- column system. My problem is that I cannot call the script that makes these widgets sortable (`jquery-ui-sortable`). Furthermore, I would like to get the order saved somewhere, is there another script for this? Where does the Dashboard natively save the Dashboard widget order? Any help would be greatly appreciated.


How do i change the tags and taxonomies

Ok i found the code to change the "TAGS" to another name.. I changed my tags to say "Celebrities" but the permalinks still says TAGS i want it to say "Celebrities" how do i do this. Here is the code i use               add_action( 'init', 'wpa4182_init');      function wpa4182_init()     {     global $wp_taxonomies;          // The list of labels we can modify comes from     //  http://codex.wordpress.org/Function_Reference/register_taxonomy     //  http://core.trac.wordpress.org/browser/branches/3.0/wp-includes/taxonomy.php#L350     $wp_taxonomies['post_tag']->labels = (object)array(         'name' => 'WPA 4182 Tags',         'singular_name' => 'WPA 4182 Tag',         'search_items' => 'Search WPA 4182 Tags',         'popular_items' => 'Popular WPA 4182 Tags',         'all_items' => 'All WPA 4182 Tags',         'parent_item' => null, // Tags aren't hierarchical         'parent_item_colon' => null,         'edit_item' => 'Edit WPA 4182 Tag',         'update_item' => 'Update WPA 4182 Tag',         'add_new_item' => 'Add new WPA 4182 Tag',         'new_item_name' => 'New WPA 4182 Tag Name',         'separate_items_with_commas' => 'Separata WPA 4182 tags with commas',         'add_or_remove_items' => 'Add or remove WPA 4182 tags',         'choose_from_most_used' => 'Choose from the most used WPA 4182 tags',     );          $wp_taxonomies['post_tag']->label = 'WPA 4182 Tags';     }      but the permalinks still say "tag" why is that


Determining the "current_page" in WordPress Custom Menus

I am using WordPress Custom Menus. I have links like   * **Home** - Rendered using `home.php`   * **Blog** - Rendered using `page-blog.php` with `WP_Query` to get blog posts   * **Services** - Page    * **Portfolio** - Rendered using `page-portfolio.php` to get all posts of the Custom Post Type "Portfolio"   * **Contact** - Page I will like to determine which link is current and style them. How will I do that? WordPress wont know which is selected when I am in a simple blog post for example `single.php`


Update the values from specific custom fields for 70 pages

I have a wordpress site with more than 70 pages of different brand car offers. Each page has a custom field named Price with a numeric value. This is what I got so far:               function setup_modificari_pret() {     add_menu_page(         'Modificari pret', 'Madificari Pret', 'manage_options',         'modificari-pret', 'setari_modificari_pret');     }     add_action("admin_menu", "setup_modificari_pret");               function setari_modificari_pret() {     ?>
         <?php screen_icon('themes'); ?>
Modificari de pret
         <form method="POST" action="">

                                                                           Valoare numerica:                                              	                                 <input type="text" name="modifica_pret" value="<?php echo $pret_modificat;?>" size="5" /> %

         </form>

         <input type="submit" value="Save" class="button-primary"/>
          <?php     }          if (isset($_POST["update_settings"])) {     $pret_modificat = esc_attr($_POST["pret_modificat"]);       update_option("nume_tema", $pret_modificat);     $pret_modificat = get_option("nume_tema");     }      I want to add an option page settings to update all the prices from the database with the possibility to increase or decrease them with 10%. How can I achieve this ?


How to have "the most used tags" taxonomy always expanded?

How can I have some taxonomies to always have "the most used tags" displayed when a new post is being created. Thanks.


Wordpress Plugin Setting's POST

I've developed a few plugin for Wordpress. Currently I've not been able to replicate the way wp save settings. I've a setting page which I learned from a tutorial. It POST to `option.php`, and wp take care of saving the data. But I have some custom option page which require more complex handling. Basically I wanted to POST some data to my own php, then redirect back to the original page/url after handling. I can't find a "proper" way to redirect correctly, i.e. without load the whole page then redirect using javascript. Currently I use GET with `add_query_arg()`, the url will display the data that I passed. Using POST will trigger a redirect prompt when refreshed. Is there a built in wp function that does it automatically? OR If I were to POST to `option.php`, how should I access the data without it handling automatically? EDIT: Example of one of the complex page would be like this: I assign a usermeta to some users which we would call SU (SpecialUser). To ease the job of admin, I have a page to display the list of users with a column showing whether they are SU. The text in that column of each row is a link which if clicked, will toggle the state of SU for that user. Currently I use GET, to pass the id of the user and also action to be carried out. Then page itself will detect, if both action and id is valid, the state of the user is toggled. At the same time, the updated result is displayed. The GET query remain at the URL What I would really like to do is to use POST, pass the id and action to the same page, then toggle the state but not displaying anything, then "redirect" back to the page displaying the updated user list. What I've tried earlier while implementing this is to use javascript to redirect the page, but this means it will have to load the whole page before the javascript can be executed. It's not resource friendly. I would like it to work much like how the Settings API would. Sorry for the long explaination. I'm sure there's a term to what I wanted to do, but I'm not sure what it is. Thanks EDIT: It's more or less like the Plugin page, when you activate/deactivate the plugin. The plugin page is using GET. The problem I have is actually redirecting, so GET or POST shouldn't matter.


Is there a more efficient admin search function/plugin?

Writers on our large Wordpress installation love to use the the content searching functionality. As convenient as this functionality is, the complexity of its queries slows down our database considerably. Here's an example of an SQL query I found in our slow query log from just a few minutes ago:               SELECT SQL_CALC_FOUND_ROWS  wp_posts.ID      FROM wp_posts       WHERE 1=1       AND (         ((wp_posts.post_title LIKE '%Made%') OR (wp_posts.post_content LIKE '%Made%'))          AND ((wp_posts.post_title LIKE '%in%') OR (wp_posts.post_content LIKE '%in%'))          AND ((wp_posts.post_title LIKE '%the%') OR (wp_posts.post_content LIKE '%the%'))          AND ((wp_posts.post_title LIKE '%shade:%') OR (wp_posts.post_content LIKE '%shade:%'))          AND ((wp_posts.post_title LIKE '%Easy%') OR (wp_posts.post_content LIKE '%Easy%'))          AND ((wp_posts.post_title LIKE '%tips%') OR (wp_posts.post_content LIKE '%tips%'))          AND ((wp_posts.post_title LIKE '%to%') OR (wp_posts.post_content LIKE '%to%'))          AND ((wp_posts.post_title LIKE '%care%') OR (wp_posts.post_content LIKE '%care%'))          AND ((wp_posts.post_title LIKE '%for%') OR (wp_posts.post_content LIKE '%for%'))          AND ((wp_posts.post_title LIKE '%your%') OR (wp_posts.post_content LIKE '%your%'))          AND ((wp_posts.post_title LIKE '%outdoor%') OR (wp_posts.post_content LIKE '%outdoor%'))          AND ((wp_posts.post_title LIKE '%furniture%') OR (wp_posts.post_content LIKE '%furniture%'))     )       AND wp_posts.post_type = 's5_post'      AND (         wp_posts.post_status = 'publish'          OR wp_posts.post_status = 'future'          OR wp_posts.post_status = 'draft'          OR wp_posts.post_status = 'pending'          OR wp_posts.post_status = 'private'     )       ORDER BY wp_posts.post_date DESC LIMIT 0, 20      Check out the size of that guy! It's no wonder it runs slowly. I'd be interested to hear ideas on how to code up some tweaks to this functionality to make it be a bit more efficient. (I already have a few ideas of my own; hopefully yours are better than mine! :) )