title: Walker only returns one child page

text:
I'm trying to create a menu on a page showing all of its sub-pages. I want to add an image to the link so I'm using a walker to edit the output of wp_list_pages. But when I call the walker only the first sub-page is returned. In functions.php I have the following code:               function list_product_pages() {        global $post;        $walker = new Walker_Product_Menu();       $childpages = wp_list_pages( array(          'sort_column'=> 'menu_order',         'title_li'=>'',         'child_of'=> $post->ID,         'echo'=>0         ,'walker' => $walker                 ));       return '
' . $childpages . '
';     }          class Walker_Product_Menu extends Walker {     function start_el(&$output, $object, $depth = 0, $args = array(), $current_object_id  = 0 ) {       $output .= $indent .         sprintf("

%s

",         get_permalink($object->id) ,         strtolower(str_replace(" ", "-", $object->post_title)),         $object->post_title          );       }     }      And in the template for the page I call it like this:               <?php echo list_product_pages(); ?>      When I remove the walker all child pages are returned. I turned on debugging and these errors appear: Warning: Illegal offset type in \wp-includes\class-wp-walker.php on line 215 Warning: Illegal offset type in \wp-includes\class-wp-walker.php on line 233 Which are both:               $children_elements[ $e->$parent_field ][] = $e;


title: Retrieving links and names of images from a NextGEN gallery

text: I want to add a list (like a cd track list) of names and links to all images next my nextgen gallery, how can I retrieve this list? (similar to the list in the select object in the Gallery Settings, in the gallery admin page)


title: Force redirect single.php to index

text: I want to make a force redirect for single.php to index so that it is never reachable by direct access (the site is built in a way that you retrieve all the content on the index page, still need to have this page available though because of an ajax function). I assume this is done in .htaccess? Edit: I need to be able to access the single.php through an ajax request from the index page, i.e. the redirect should only occur upon direct url access.


title: Is wp-content/install.php a Drop-in?

text: I cannot find documentation or discussions on what is and how to use Drop-in plugins.   The question was raised in this Q&A, Populate content on install. _Is a`wp-content/install.php` file that redefines the pluggable function `wp_install_defaults` a Drop-in plugin or not?_ # My research results The following list is from hakre's article _(which seems to be the origin of all other copies in the interwebs)_.               File                Type of Plugin                          Loaded                          Context     advanced-cache.php  Advanced caching plugin.                on WP_CACHE value               Single     db.php              Custom database class                   always                          Single     db-error.php        Custom database error message           on error                        Single     install.php         Custom install script                   on install                      Single     maintenance.php     Custom maintenance message              on maintenance                  Single     object-cache.php    External object cache                   always                          Single     sunrise.php         Executed before Multisite is loaded     on SUNRISE value                Multi     blog-deleted.php    Custom blog deleted message             on deleted blog                 Multi     blog-inactive.php   Custom blog inactive message            on inactive blog                Multi     blog-suspended.php  Custom blog suspended message           on archived or spammed blog     Multi          Source: Data taken from global function _get_dropins() in wp-admin/includes/plugin.php.      * * * In the Codex a Drop-in is defined as: > The concrete PHP-file * * * At first, there's nothing on [wp-hackers] list. And searching for "drop-in + wordcamp" I've only found this of relevance _my emphasis_ : > One of the great strengths of WordPress is its plugin system. In the > upcoming 2.1 release, **_there is very little you can’t do as a drop-in > plugin_**. This makes it easy to use WordPress as a CMS and keep your > customizations separate from the main codeline; which in turn simplifies > upgrades and maintenance.


title: Is it possible to set individual shipping prices in Woocommerce?

text: I currently have a store running on Bigcommerce, but unfortunately it doesn't offer the functionality that I require. I am debating whether to use a magento/wordpress install or wordpress/woocommerce. Does anybody out there know if it is possible with woocommerce (or additional plugins) to perform the following: Set an individual item with a fixed shipping price to different regions/countries. Offer a free shipping option on orders of a particular item over a given amount. I believe this would possible with magento, but it appears to be a quite heavy weight option for a wordpress blog/ e-commerce store. Thanks in advance for any assistance with the above.


title: Inserting images in multiple posts native gallery

text: I am trying to find a solution to a problem that Wordpress seems to lack. Here is a scenario: I have uploaded images to a post using the native gallery to display the images. These images then appear under the gallery tab within the upload/insert and they will appear on the post. Works perfectly. Further down the line I create a new post, I want to include images from my Media Library into the gallery without re-uploading the same images again. I expected to find, "Insert into gallery", next to "Insert into post", but there doesn't seem to be a way of doing this. Is there a solution to this? I have done a lot of theme development in the past, but amazed at there isn't a simple solution to this problem. I would be grateful for any help.


title: Hide sub domain created for local CDN

text: Not sure if my question would make sense or not. I have created a sub-domain to store some of my static files (like images). So, some images now load from **http://imgs.example.com/imagefilename.png** Now, the problem is, all the files stored under this sub domain http://imgs.example.com/ are publicly visible which I want to hide or redirect or show 404. Any idea how to achieve this? Currently files in the subdomain shows -- **Index of /**   * cgi-bin/    * onevideofile.mp4   * oneimagefile.png _Apache Server at imgs.iconicwebteam.com Port 80_


title: Display two custom values from a post

text:
I'm using the following code to display a custom value. The custom value being 'website'               <?php       $custom_fields = get_post_custom($post_id); //Current post id       $my_custom_field = $custom_fields['website']; //key name       foreach ( $my_custom_field as $key => $value )       echo $key . " => Click Here
";     ?>      However, before the 'Click here' i'd like to include another custom value, thumb. So the output would be:               Value of custom field thumb     Value of custom field website      Thanks.


title: which is this plugin ?

text: can somebody tell me which is this plugin used in comment rating ? http://goo.gl/AWxl5 see on comment thanks in advance


title: Exclude Child Posts from WP_Query

text: How can I exclude child posts using wp_query? Given the following architecture:   * parent 1      * child 1     * child 2   * parent 2      * child 3     * child 4 I'd like to only return parent 1 and parent 2, and exclude child 1, 2, 3 and 4. I've searched high and low for an answer to this question. Nothing surfaces.


title: How do I fill the Home Description?

text:
For some reason All in One Seo is not putting the text that I put in the Home Description field if you google, dvdripfreemoviedownloads.com, the first result, which is my homepage should have something else under the Home Description? Anyone know how I can fix this will All in One SEO If anything I'd like to imput the Home Description manually. I heard that it can be done by inputting that in the header.php, How do I do it manually? below is my header.php                   <?php     // Press75.com     ?>     <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">                                           <title>         <?php if ( is_home() ) { ?><?php bloginfo('name'); ?> | <?php bloginfo('description'); ?><?php } ?>         <?php if ( is_search() ) { ?><?php bloginfo('name'); ?> | Search Results<?php } ?>         <?php if ( is_author() ) { ?><?php bloginfo('name'); ?> | Author Archives<?php } ?>         <?php if ( is_single() ) { ?><?php wp_title(''); ?> | <?php bloginfo('name'); ?><?php } ?>         <?php if ( is_page() ) { ?><?php bloginfo('name'); ?> | <?php wp_title(''); ?><?php } ?>         <?php if ( is_category() ) { ?><?php bloginfo('name'); ?> | Archive | <?php single_cat_title(); ?><?php } ?>         <?php if ( is_month() ) { ?><?php bloginfo('name'); ?> | Archive | <?php the_time('F'); ?><?php } ?>         <?php if (function_exists('is_tag')) { if ( is_tag() ) { ?><?php bloginfo('name'); ?> | Tag Archive | <?php  single_tag_title("", true); } } ?>         </title>                       <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />         <?php if (is_single() || is_page() ) : if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>         <meta name="description" content="<?php the_excerpt_rss(); ?>" />         <?php endwhile; endif; elseif(is_home()) : ?>         <meta name="description" content="<?php bloginfo('description'); ?>" />         <?php endif; ?>                       <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />         <link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/style.css3.css" type="text/css" media="screen" />                                                   <link rel='stylesheet' type='text/css' href="<?php bloginfo('url'); ?>/?sf-custom-content=css" />                       <link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />         <link rel="shortcut icon" href="<?php bloginfo('template_url'); ?>/images/favicon.ico" type="image/x-icon" />              <?php if (is_singular() && get_option('thread_comments')) wp_enqueue_script('comment-reply'); ?>              <?php wp_head(); ?>              <?php if (get_option(THEME_PREFIX . "analytics_code")) { ?>             <?php echo get_option(THEME_PREFIX . "analytics_code"); ?>         <?php } ?>

                 <?php if (get_option(THEME_PREFIX . "header_ad")) { ?>
                     <?php echo ($header_ad = get_option(THEME_PREFIX . 'header_ad')); ?>
                 <?php } ?>
                 <?php if (get_option(THEME_PREFIX . "logo_txt")) : ?>
<a href="<?php echo get_option('home'); ?>/" title="Home" ><?php echo get_option(THEME_PREFIX . "logo_txt"); ?>
                 <?php else : ?>                     <a href="<?php echo get_option('home'); ?>/" title="Home" ><img class="fade" src="<?php echo ($logo = get_option(THEME_PREFIX . 'logo_img')) ? $logo : get_bloginfo("template_url") . "/images/logo.png"; ?>" alt="<?php bloginfo('name'); ?>" />                 <?php endif; ?>

                         <?php include('searchform.php'); ?>

             <div class="navigation-inside<?php if (is_home()){echo ' navigation-video';}?><?php if (get_post_meta($post->ID, "_videoembed", true) || get_post_meta($post->ID, "_videoembed_manual", true)){echo ' navigation-video';}?><?php if (is_category()){echo ' navigation-category';}?>">                 <?php if (get_option(THEME_PREFIX . "menu_management")) : ?>                 <?php wp_nav_menu(array('sort_column' => 'menu_order', 'container_class' => 'menu-header')); ?>                 <?php else : ?>
                     <li <?php if (is_home()) { echo 'class=""'; } ?>><a href="<?php echo get_option('home'); ?>/" title="Home">Home
                          <?php wp_list_categories('title_li='); ?>                          <?php wp_list_pages('title_li='); ?>
<a href="<?php bloginfo('rss2_url'); ?>" title="Subscribe via RSS">Subscribe
                          <?php if (get_option(THEME_PREFIX . "twitter_link")) { ?>
<a href="http://twitter.com/<?php echo get_option(THEME_PREFIX . "twitter_link"); ?>" title="Twitter.com">Twitter
                     <?php } ?>
                 <?php endif; ?>

        * * * Yes I know where the Home Description goes in All in one seo. I've used it on my other sites but there's something up with this theme I think But can someone tell me how to input this manually in the header.php please?


title: add_rewrite_rule not working

text: I'm trying to do some url rewriting. I've picked this example right off the wordpress wiki here:               add_rewrite_rule('^nutrition/([^/]*)/([^/]*)/?','index.php?foo=bar','top');      The wiki page says: > This example would match a requested URL like this: > example.com/nutrition/milkshakes/strawberry/ ...and interpret it to actually > mean...   >  example.com/index.php?page_id=12&food=milkshake&variety=strawberry (I've simplified it to redirect to index.php?foo=bar ). However, I'm still getting a 404 error when I try to visit `http://localhost/myblog/nutrition/milkshakes/strawberry/`. What am I doing wrong?


title: Wordpress custom login page

text: I found a little article on how to create a custom Wordpress Login page and I am wondering if this technique/practice is safe to use? The article: http://blog.caercam.org/2012/09/21/wordpress-login-page-complete- redesign/ I have tried this technique but the **Logout** function stopped working in wordpress and if i write the wrong account username or password and click **login** it redirects me to the old **login** page is there a way to fix these problems? I am using all the same code as in the article.


title: Placement of categories

text: I have installed the zAlive theme onto my domain, and it has four tabs at the top on a slidebar. I was wanting to have these tabs in the slidebar, be linked to my different categories, but I'm not sure how to do this. My hopes are to have it so that as you select different tabs from the slidebar, the corresponding posts in each category with show underneath. Any help on this would be appreciated.


title: What is a "protected" post status?

text: I noticed in the `register_post_status` function in core that there is an arg for 'protected'. The following post statuses: 'future', 'draft', and 'pending' all have this set to **true**. I'm not talking about a protected 'post' but the 'protected' argument used when registering a custom `post_status`. What does this 'protected' status do? And why would I make a custom post status protected?


title: Removing base slug from hierarchical custom post type

text: I have a hierarchical custom post type called "state". My goal is to have a permalink structure like thus: http://website.com/idaho/ http://website.com/idaho/sub-page I'm _close_ but haven't quite figured it out. Here's the code I'm using: **First, I remove the slug**               public function remove_slugs( $permalink, $post, $leavename ) {                 $url_components = parse_url( $permalink );           $post_path = $url_components['path'];           $post_name = end( explode( '/', trim( $post_path, '/' ) ) );                if( !empty( $post_name )) {                  switch($post->post_type) {                    case 'state':                      if( $post->post_parent ) {                          $parent = get_post( $post->post_parent );                     $parent = $parent->post_name;                          $permalink = str_replace( $post_path, '/' . $parent . '/' . $post_name . '/', $permalink );                      } else {                           $permalink = str_replace( $post_path, '/' . $post_name . '/', $permalink );                 }                      break;                  }                }                return $permalink;              }      This is hooked into `post_type_link`. **Next, I reset the query variables so WordPress knows we're dealing with a CPT**                   public function parse_custom_post_type( $query ) {                  if ( ! $query->is_main_query() ) return;             if ( count( $query->query ) != 2 || ! isset( $query->query['page'] ) ) return;                  // Are we dealing with a page?             if ( ! empty( $query->query['pagename'] ) && ! is_home() ) {                      // If the page doesn't exist, we must be dealing with a state                 if ( ! is_page( $query->query['pagename'] ) ) {                     $query->set( 'name', $query->query['pagename'] );                     $query->set( 'state', $query->query['pagename'] );                     $query->set( 'post_type', 'state' );                     $query->is_page = 0;                     $query->is_single = 1;                     unset( $query->query_vars['page'] );                     unset( $query->query_vars['pagename'] );                     unset( $query->query['page'] );                     unset( $query->query['pagename'] );                 }             }              }      This is hooked into it `pre_get_posts`. So, the level _one_ pages work, but not the subpages. The URLs resolve and then hit a 404. What do I need to do to get this working?


title: Custom fields in post later used in loop

text: How i can add custom fields to custom post templates, and later print them in The Loop? Better explanation: I want to have a custom field in "Add New" window, which will be added as some meta data to the post, which can be later printed in the loop of single.php. I want to be able to decide where it will be, so it can be even under comments if i want to (i want to define it in template). I dont want "Custom Field Template" plugin because AFAIK this cannot be used inside the loop.


title: Passing variables to new page

text:
I'm trying to pass the variables to a new page, I made a function in my theme to get the results. Now when I use `yelplist();` on the front page of my theme it gets the results and when i click on the link it passes the image and city back to me as requested. **Questions:**   * However I am wondering what i can do to have variables pass to their own page. For example: if I click on the name, a new page comes with the results of an image and a city for that link.    * Also is it possible to have it done in the single.php file, or will it be a completely new page/file? **Update 1** *I've made a little bit of progress using $_SESSIONS, I am now able to pass the variables into the single.php file however, when I click on the link thats suppose to grab the results from the current link it does not update the variables that are in the single.php file, instead its only getting the last parsed link's info instead of the one I am clicking on. Also when I click on the link at the bottom and make it try to go to the single.php file I get a object not found `<a href='single.php?p=$pizza_url'><img border=0 src='".$business->photo_url."'></a>` what can I do to make it go to the single page and update the variables? this is what I have in my functions file.               function yelplist(){          require_once ('/lib/OAuth.php');      require_once ('yelp.php');      require_once(ABSPATH.'/wp-admin/includes/taxonomy.php');          $yelpstring = file_get_contents('http://api.yelp.com/business_review_search?term=pizza&location=Los%20Angeles&ywsid=xxxxxxxxxxxxxxxxxxx');     $obj = json_decode($yelpstring);                  foreach($obj->businesses as $business):                 $business->photo_url;                 $pizza_name = $business->url;                 $business->name;                 $business->phone;                 $city = $business->city;                      $url = ''.$business->url.'';                 $pizza = parse_url($url, PHP_URL_PATH);                 $pizza_url = trim(''.$pizza.'','/biz');                 $lower_case_city_url = $city;                 $lower_case_city_url = strtolower($lower_case_city_url);                 $city_url = str_replace(' ','-',$lower_case_city_url);                      if(isset($_SESSION['p']) && $_SESSION['p']==''.$pizza_url.'') {                      $_SESSION['pizza_name']= $business->name;                  $_SESSION['pizza_city']= $city = $business->city;                  $_SESSION['pizza_phone']= $business->phone;                 $_SESSION['pizza_photo'] = $business->photo_url;                  }else{                  echo "
$business->name
";                 }             endforeach;             }      this is what im using in the single.php file to grab the results.               <?php session_start(); ?>     <?php echo $_SESSION['pizza_name']; ?>
     <?php echo $_SESSION['pizza_phone']; ?>
     <?php echo $_SESSION['pizza_city']; ?>
     <?php echo ""; ?>      Thanks


title: How do I embed a YouTube video in WordPress 3.0?

text: I've upgraded to version 3.0. My site is wordswithfriends.net My administration panel looks like the following ![Add New Post screenshot with toolbar](http://dl.dropbox.com/u/12337149/wp.png) I thought there was supposed to be a special YouTube button which I don't seem to have. Adding media asks for URL + text and I just get a link not embedding.


title: Switching to child theme breaks menu names

text: When I switch to the child theme I am working on, the main menu uses the page names instead of the names that I gave it in the Appearance > Menu options. Happened to anyone else?


title: woocommerce retriving category name as div class?

text:
I am trying to retrieve the category name of a WooCommerce product displayed in a WordPress loop and use it as the class for an `li` (also inside the loop). I've tried this:

         <?php while (have_posts()) : the_post(); ?>                  <li class="<?php echo $product->get_categories(); ?> box">                 <a href="<?php the_permalink(); ?>"><?php echo the_post_thumbnail(); ?>
<a href="<?php the_permalink(); ?>"><?php the_title(); ?>
                 <a href="<?php the_permalink(); ?>"><span href="<?php the_permalink(); ?> " class="amount price" data-original="<?php echo get_woocommerce_currency(); ?><?php echo $product->get_price(); ?>" data-price="<?php echo $product->get_price(); ?>" title="Original price: <?php echo $product->get_price(); ?>"><?php echo get_woocommerce_currency(); ?><?php echo $product->get_price(); ?>                 <a href="<?php the_permalink(); ?>?add-to-cart=<?php echo $post->ID ?>" class="pbutton">Add to Cart
         <?php endwhile; ?>
      This is the part where I'm trying to retrieve:               <li class="<?php echo $product->get_categories(); ?> box">      but it just outputs this:
      which not only doesn't retrieve the category but also screws with the markup, breaking the loop. I've also tried this: `<li <?php post_class('box'); ?>` but because WooCommerce uses taxonomies, it retrieves the tags but not the product category. This question is a follow up on this.


title: how to query posts and auto assign category if post title has keyword

text: how can i query posts by current date and auto assign category based on keyword found on post title, something like if title contains 'oranges' auto assign it 'oranges' category maybe something like this which can go to functions.php               function add_category_automatically($post_ID) {     global $wpdb,$post;             $today = getdate();        $query = new WP_Query( 'year=' . $today["year"] . '&monthnum=' . $today["mon"] .'&day=' . $today["mday"] );     while ( $the_query->have_posts() ) : $the_query->the_post();            $post_title = get_the_title();        if (stripos($post_title, 'oranges')!==false) {         $cat = array(8);         wp_set_object_terms($post_ID, $cat, 'category');     }      endwhile;     }      add_action('publish_post', 'add_category_automatically');      the above code doesn't work although this code below works but it doesn't really do it for existing posts until i update them again, so i want a function to query all the posts by current date and it should only run if found new posts for today                   function add_category_automatically($post_ID) {     global $wpdb,$post;                 $post_title = get_the_title();          if (stripos($post_title, 'oranges')!==false) {         $cat = array(8);         wp_set_object_terms($post_ID, $cat, 'category');       }               }           add_action('publish_post', 'add_category_automatically');      Update: i am using this code now , it works if i publish a new post but doesnt work for existing posts??? ..... it should run every time and check all the posts in the database and auto categorize the post but smhw its not                      add_action( 'wp_insert_post', 'update_post_terms' );            function update_post_terms( $post_id ) {           if ( $parent = wp_is_post_revision( $post_id ) )         $post_id = $parent;        $post = get_post( $post_id );         if ( $post->post_type != 'post' )         return;          $post_title = get_the_title();            if (stripos($post_title, 'oranges')!==false) {               // add a category           $categories = wp_get_post_categories( $post_id );             $newcat    = get_term_by( 'name', 'oranges', 'category' );             array_push( $categories, $newcat->term_id );             wp_set_post_categories( $post_id, $categories );          }              }      i know it will put a good load on my database even if i figure this out but i am looking for a way to do this like one instance every two hours or something like that, Please help! **Update 2 to check all posts and loop them to push the category**                $postids = array();        //this is to tell the script to only pull posts that are labeled "publish"       $args=array(          'post_type' => 'post',           'post_status' => 'publish',           'posts_per_page' => -1,           'caller_get_posts'=> 1        );       $my_query = null;     $my_query = new WP_Query($args);        if ( $my_query->have_posts() ) {     while ($my_query->have_posts()) : $my_query->the_post();     $postids[]=$my_query->post->ID;     endwhile;      }      wp_reset_query();  // Restore global post data stomped by the_post().           $i = 0;            while ($num_of_posts > $i){       $post_id = $postids[$i];       add_action( 'wp_insert_post', 'update_post_terms' );       function update_post_terms( $post_id ) {       if ( $parent = wp_is_post_revision( $post_id ) )         $post_id = $parent;        $post = get_post( $post_id );       if ( $post->post_type != 'post' )         return;       $post_title = get_the_title();      if (stripos($post_title, 'oranges')!==false) {           // add a category       $categories = wp_get_post_categories( $post_id );       $newcat    = get_term_by( 'name', 'Oranges', 'category' );       array_push( $categories, $newcat->term_id );       wp_set_post_categories( $post_id, $categories );      }      }       $i++;      }


title: Modify Search Query if original Query gave no results

text: I'm looking for a way to modify the search query if the performed query returned no results. Let's say I'm looking for "Opening times", so I go to this URL:               http://mysite.com?s=Opening+times      Now, in my `search.php` I want to check if that query gave no results, and in that case, I want to perform a new query with a different term, wihtout any required action by the user. Something like this:               global $wp_query;          $total_results = $wp_query->found_posts;          if ( $total_results == 0 ) {         // Create a new query with the terms 'Find Us'     }          // Display results (either those for the 'Opening times' query or for the 'Find Us' one if the former didn't return any result)      Is there an easy way to do this?


title: Permalink target for recent post

text: I am trying to set up code to submit a post to StumbleUpon, from my Rothmania site. The code reads `href="http://www.stumbleupon.com/submit?url=<?php the_permalink(); ?>&title=<?php the_title(); ?>" alt="" title="">` and when on a single post view, it pulls the info just fine, offering to submit that particular post. When on the home page, I'd like it to submit the most recent, top post, right now it's loading the last one at the bottom of the page. Note: this is hand coded, unrelated to the theme, and not using a plugin. Any help here will be appreciated. Edit - I now have this code -               <?php     $su_link = $su_title = '';          if (is_single()) {         // We're showing a single blog post         // => take the data and deal with it         $su_link = get_permalink();         $su_title = get_the_title();     } elseif (is_home()) {         // We're showing the 'home' archive         // => take the first post's data and deal with it         $ID = $GLOBALS['posts'][0]->ID;         $su_link = get_permalink($ID);         $su_title = get_the_title($ID);     }          if ('' !== $su_link) {         // We have data         // => generate the link         echo ''             .'Link'             .'';     }     ?>                      <title>CoffeeCup Image Mapper map file</title>       <meta name="generator" content="CoffeeCup Image Mapper">                                        <map name="sociallinks">       <area name="facebook" shape="rect" coords="19,0,76,48" href="https://www.facebook.com/joetaxpayer"  alt="" title="">       <area name="twitter" shape="rect" coords="73,0,129,48" href="https://twitter.com/JoeTaxpayerBlog"  alt="" title="">       <area name="stumble" shape="rect" coords="126,0,179,48" href="http://www.stumbleupon.com/submit?url=<?php the_permalink(); ?>&title=<?php the_title(); ?>"  alt="" title="">       <area name="rss" shape="rect" coords="177,0,243,48" href="http://rothmania.net/feed/"  alt="" title="">     </map>                     When I temporarily loaded to the site it offers a 'link' that works perfectly, but I'm staring at this code, not understanding how to link from the proper icon, instead of the word 'link'. I appreciate the help here, and yes, I'm in over my head.


title: Code auto escaping is not working when using short codes

text:
I'm using this ages old, but still well working, plugin (source code here) to auto escape html inside `<code>`. All is well and good until I tried to use short codes to form the `<pre><code>` blocks. This is the short code code I use:               // HTML code block     function short_code_markup( $atts, $content = null ) {         return "
" . $content . "
";     }     add_shortcode( 'html', 'short_code_markup' );      Does it have something to do with the order the scripts being executed? Here are the filters the plugin applies:               add_filter('content_save_pre', 'pri_cae_mask', 28);     add_filter('content_save_pre', 'pri_cae_unmask', 72);     add_filter('the_content', 'pri_cae_mask', 1);     add_filter('the_content', 'pri_cae_unmask_replace', 99);          add_filter('excerpt_save_pre', 'pri_cae_mask', 28);     add_filter('excerpt_save_pre', 'pri_cae_unmask', 72);     add_filter('the_excerpt', 'pri_cae_mask', 1);     add_filter('the_excerpt', 'pri_cae_unmask_replace', 99);          add_filter('pre_comment_content', 'pri_cae_mask', 4);     add_filter('pre_comment_content', 'pri_cae_unmask', 36);     add_filter('comment_save_pre', 'pri_cae_mask', 28);     add_filter('comment_save_pre', 'pri_cae_unmask', 72);     add_filter('comment_text', 'pri_cae_mask', 1);     add_filter('comment_text', 'pri_cae_unmask_replace_addpre', 99);      Thanks a lot advanced :)


title: How to use in_category?

text:
There's this "Recent Posts" widget, that should output only posts in category 'News' (ID 26) So I tried this:               <?php $t =& peTheme(); ?>     <?php $content =& $t->content; ?>     <?php list($data) = $t->template->data(); ?>          <?php if (in_category('26')):?>           <?php if (!empty($data->title)): ?>
<?php echo $data->title; ?>
     <?php endif; ?>          <?php while ($content->looping()): ?>     <?php $content->date(); ?>     <?php $content->comments(); ?>
<?php echo $t->utils->truncateString(get_the_excerpt(),$data->chars); ?>     <?php endwhile; ?>          <?php if (!empty($data->link)): ?>     <a class="more-link" href="<?php echo $data->url ?>"><?php echo $data->link ?>     <?php endif; ?>     <?php endif; ?>       But it outputs a blank space where it was the widget. Is there a way I can filter to only show recent posts from category 26 there?


title: Newest version of javascript

text: Doing updates to my site and all the files seem to update ok, except the javascript files. I think this is to do with the version, but try as I might I can't get version numbering to work.                 wp_register_script ('headjq', get_bloginfo('template_directory') . "/js/headjq.js");             wp_enqueue_script('headjq');      Is there a way that I can automatically append a version number to the end to force the client to update the scripts?


title: Notice: Undefined index: filter in ...wp-includes/default-widgets.php on line 382

text: I'm getting this message on a WP 3.2.1 install with PHP version 5.2.17               Notice: Undefined index: filter in /home/netstewp/public_html/wp-includes/default-widgets.php on line 382      Any idea why?


title: list post by tags combination - required tags to list out posts

text: Im in a need to List post by tags. The posts to be listed MUST contain all the tags to be listed, not only one, but all combined. Example; mysite.xx/tag/tag+another/ should put out ONLY the post that HAVE the tags; tag AND another. (the post contain tags; another, juice should not be listed) Now, my list includes all post that is tagged with another, also when they do not have the tag tag.


title: Add SWF file to wordpress through custom template

text: I am trying to attach an swf file to my website. I have that swf file in my local system. But wordpress is not alowing me to upload the swf file into the media library. I want to add that swf to my homepage which have a specific custom template. I want to add the swf file through this template file rather than the editor. Is there anyway for that?


title: Next Previous Post in wordpress with previous / next link with title?

text:
I recently tried the previous post and the next post button link. I do that with image in the left and right side of the site.Its working perfect.But i didn't know how to do this **For Example:**
                             <?php next_post('%', ' ', 'no');                             ?>

                                  <?php previous_post('%', '  ', 'no');                             ?>
      Is it Possible to Show the Previous Post and Next Post Link with Under Title in every Bottom of the Post. Here is the Screenshot. ![enter image description here](http://i.stack.imgur.com/AbbnN.png) **EDITED:** See what I edited the code.               <?php           function nextprev() {          ?>
                             <?php next_post_link('%link', ' %title'); ?>

                             <?php previous_post_link('%link', '%title '); ?>
          <?php     $content = get_the_content();       echo $content;     }          add_action('the_content','nextprev');     ?>


title: How to translate content in category.php or index.php with qtranslate?

text:
I was wondering how to translate content under `index.php` (or `category.php` with qtranslate?). I'm using twenty twelve theme. My code on `index.php`:               <?php     /**     * The main template file.     * @package WordPress     * @subpackage Twenty_Twelve     * @since Twenty Twelve 1.0     */     ?>     <?php get_header(); ?>     <?php      $page_id = 1500;     $page_data = get_page( $page_id );     echo apply_filters('the_content', $page_data->post_content);     ?>

Latest News
     ...      I would like to translate the content inside the `<section>` and `<h1>` tag for example in french.


title: plugin class inheritance. cannot change variable

text: I guess I have a problem understanding inheritance.   I have 4 classes like so;               class FOO extends WP_Widget {         protected $pluginOptions;         function __construct() {             $this->pluginOptions = get_option('option_name',0);              /*$this->pluginOptions['email'] returns /is set to email@domain.com here*/         }     }          class FOO_ACTIONS extends FOO {         function __construct() {             parent::__construct();             /*some actions*/         }         /*some methods*/     }          class FOO_SEND_EMAIL extends FOO_ACTIONS {         function __construct() {             parent::__construct();             /*some actions*/         }         /*some methods*/     }             class BAR extends FOO{         function __construct() {             /*change email here */             $this->pluginOptions['email']='anotheremail@anotherdomain.com';         }     }     $BAR=new BAR();      in another file i am calling:               $sendEmail=new FOO_SEND_EMAIL;      I thought that - as `BAR` gets called before `FOO_SEND_EMAIL`   `$this->pluginOptions['email']` is now `anotheremail@anotherdomain.com`. However, when doing `$sendEmail` it is still set to `email@domain.com`. can anyone point me in the right direction perhaps as to where I'm going wrong here? (happy to provide more code of course if necessary).


title: widget not displayed

text: the command                echo '<pre>';print_r(wp_get_sidebars_widgets())  ;         returns                   [sidebar-page] => Array         (             [0] => execphp-5             [1] => simple-section-nav-3             [2] => execphp-4             [3] => wp-forecast-3             [4] => wp-forecast-4             [5] => execphp-6         )      but the sidebar page is not displayed instead the default bar is displayed. why?


title: Stuck with a Custom Field Check box Array

text: Been stuck on this for a while now. Haven't come across anything that has shed any light on it for me... Pardon my ignorance... quite a newbie at this level of php. The problem: I am using the wp-property plugin, but need a field that can have multiple numeric values. Using Advanced Custom Fields to set up a checkbox field that can accept multiple numeric values. I am attempting to add this field to the wp-property search function. I get a dropdown menu, but it is populated with lines that look like unformatted arrays. _s:19.a:1:{i:0;s2_ and so on. My values are in that string but I don't know what to do to single them out. I have this in my functions.php               add_filter('wpp_searchable_attributes', 'add_lease_to_searchable');      function add_lease_to_searchable($fields) {          if(is_array($fields))          array_push($fields,  'lease-space1' );               return $fields;     }      Which gets that dropdown to be a part of the wp-property function. If anybody has an idea on how to extract the values... even better put one on each dropdown line, that would be amazing. Feel stuck with no light at the end of the tunnel.


title: Is 'name' a reserved word in URL's?

text: I'm creating some custom templates and I keep running in to a problem where I get'Page not found'. After a bit of debugging, I discovered that I only get this if my URL contains `www.mysite.com/custom_page/?name=donkey_boy`. If I use `www.mysite.com/custom_page/?full_name=donkey_boy`, the page loads as it should. Does that mean that `name` is a reserved word?


title: How do I read the value of a custom field of the page?

text: When creating custom page templates, how do I get the value of a custom field of the displayed page?


title: How can I migrate from another platform to WordPress (using the same domain) and launch when ready?

text: Currently, I have a blog that runs atop Tumblr, which is relatively young (3 months old or so, maybe 25 posts altogehter) that I want to migrate to a self- hosted Wordpress installation. I've installed and configured Wordpress many, many times, but I've never been able to figure this out. Here's what I'd like to do, ideally:   * First, keep the existing blog up and active during the entire process   * Install Wordpress somewhere public and migrate the content either by hand or using an import tool of some kind   * Install whichever theme I end up using, customize the crap out of it   * Switch the DNS for my domain so that users gradually begin to see the fully built and migrated Wordpress site instead of the Tumblr site. Here are the problems with this as I understand them: I won't be able to install the Wordpress blog within the domain in which it will ultimately live because that domain points somewhere else. For this reason, I'll need to install it on a different domain (test.realdomain.com or something) and do all of the import and theme dev stuff there. The bad part here is that Wordpress uses the post's full URL as it's GUID, so I'll have to hand-edit the database so that each post, page and media asset lives at realdomain.com instead of test.realdomain.com. I'm wondering if, in all of my Wordpress travels, I've somehow missed a super easy solution to this problem. For a product as mature as Wordpress, I find it hard to believe that there's no easy way to, say, build a site in a staging environment and deploy it to production without have to manually edit database tables. Any assistance offered would be greatly appreciated, and feel free to let me know if I've left out any details that would help clarify anything. Thanks!


title: How to check if new posts have been published since page load?

text: My aim is to use the Heartbeat API to check if new posts have been published since the blog's homepage was loaded. If new posts have been published, I will display a link at the top of the screen "16 new posts" which, when clicked, will insert the new posts into the DOM. **My problem:** How can I check if new posts have been published since the blog's homepage was loaded? **My PHP so far:**               function new_post_check( $response, $data, $screen_id ) {              // Do some processing here.              // Respond.         return $response;     }     add_filter( 'heartbeat_received', 'new_post_check', 10, 3 );     add_filter( 'heartbeat_nopriv_received', 'new_post_check', 10, 3 );      **My script so far:**               $( document ).on( 'heartbeat-tick.poll', function( event, data ) {         // Print data to the console.         console.log( data );     });


title: Create a theme by combining a parent and a child theme

text: I have an existing parent theme and a child theme. I have a need for one theme that has the power of the parent theme and the design of the child theme. Is there anyway to quickly combine these two themes to make one standalone theme??


title: How to add a description to the user name input field in the registration form?

text:
I want a description **under the user name input field** in the Wordpress registration form like in the next example. How can I do this?               //create an extra field in login page for invitation code     add_action( 'register_form', 'add_invitation_code_field' );          function add_invitation_code_field() {        ?>
                               Invitation code                 <input id="invitation_code" class="input" type="text" size="20" value="" name="invitation_code"/>                 <?php _e("Description text"); ?>
        <?php     }


title: Categories under custom post types doesn't show properly

text: I used a custom post type in my website: I added `archive-{mytaxonomy}.php` and also `single-{mytaxonomy}.php`. I also created a separate sidebar for my taxonomy and everything looks fine until I click on one of my categories. Then it loads `archive.php`. Should I add any other code to my files?


title: Remove index.php from WP 8.0 install migrated to IIS from Apache (still detecting Apache server)?

text: I was developing this WP site using WAMP at work, and now suddenly we're switching it up and putting it on a Windows server (2003). I can tell from the Permalinks Settings page in wp-admin that it still thinks it's still running on Apache, because it gives me code for `.htaccess` instead of `web.config` file. So I've tried all the fixes I've found around the web, some of them for WP on Windows/IIS still are `.htaccess` fixes, which I don't understand since IIS/Win doesn't use `.htaccess`. I found one solution involving .htaccess but seemed to have a prerequisite of PHP ISAPI, but wasn't very clear about that and I can't figure out how to install it anyway (very unfamiliar with Windows Server). I've tried solutions provided for `web.config`, also to no avail. One resource said to remove `'/index.php'` from the condition `if( ! got_url_rewrite ) { $prefix = '/index.php'; }` in `wp-admin/options- permalink.php`, that didn't work either. How can I change WP to read the correct/current server type? Just to get WP "on the same page". Then, does anyone maybe have any other suggestions for me to get `index.php` out of the URL?


title: How to add a class name to the ancestor <li> of a post?

text: I've asked this question before with a different Question Title over at Stackoverflow. At that time, I was not yet aware that a function of the theme is adding a class name called current-menu-item. But now I knew that already, and a function of the theme is adding an .active class name to it whenever it is active. I am using WP-Bootstrap theme by 320Press, that uses the Bones Theme Framework. Now, I also wanted to add an .active class name to a parent `<li>` link, whenever any of it's child `<li>` link or `<a>` link is active, or whenever a single post is active from any child `<li>` link (category or sub-category). I've created a menu from the admin panel using the add menu widget. The menu's parent item is called BLOG, and it's child items are the categories of the BLOG. Basically, the Blog Menu is a child item of my TOP NAV BAR MENU. My TOP NAV BAR MENU, holds the Home, Blog, and Information Menu. Clicking the BLOG menu will trigger the drop down menu function of the theme and shows the available blog categories. I've setup my Permalink Settings to Custom Structure like this, http://mysite.com//blog/%postname%/ My main goal is, to add an .active class to the `<li>` (which is a child of my main nav link), whenever any child `<li>` or `<a>` link or single post is active, like so. Add .active class when: http://mysite.com/blog/ is acccessed http://mysite.com/blog/category is accessed http://mysite.com/blog/post is accessed The function code from my installed theme               add_filter('nav_menu_css_class', 'add_active_class', 10, 2 );     function add_active_class($classes, $item) {         if($item->menu_item_parent == 0 && in_array('current-menu-item', $classes)) {                 $classes[] = "active";         }         return $classes;     }      Udpate: I can't put this in my comment, so I did put it here:               $output .= apply_filters( 'walker_nav_menu_start_el', $item_output, $item, $depth, $args );       What this tries to do? **UPDATE** My theme uses the Bootstrap Walker Menu **UPDATE** I've found a code block and applied it to my `function.php` and it worked. It adds a class name of menu-parent-item to the parent of the current menu item.                   add_filter( 'wp_nav_menu_objects', 'add_menu_parent_class' );     function add_menu_parent_class( $items ) {              $parents = array();         foreach ( $items as $item ) {             if ( $item->menu_item_parent && $item->menu_item_parent > 0 ) {                 $parents[] = $item->menu_item_parent;             }         }              foreach ( $items as $item ) {             if ( in_array( $item->ID, $parents ) ) {                 $item->classes[] = 'menu-parent-item';              }         }              return $items;         }      I can now further target the class name and add the .active class.


title: What exactly is the description field when uploading an image?

text: This is a really basic question and I am slightly embarrassed I do not know, but what exact purpose does the description field serve, when uploading an image with Wordpress? Typically when uploading an image I include a title (maybe) and some alt text. I always thought alt text was to help people with disabilities, so I try to always include it; I usually copy the alt text to the description (which I think would be bad practice), but I can't seem to 'see' the description text anywhere (whilst viewing source). Is it the same as `longdesc`? Any help is appreciated!


title: How do I change the URL returned by next_posts_link()?

text: I am integrating a WordPress blog into my existing portfolio, test.mysite.com. The WordPress default twenty twelve blog appears on test.mysite.com/blog/. I want to integrate WordPress functionality into my existing portfolio, so I have created a page at test.mysite.com/blog.php. I just added the next/previous page functions to the blog page. **My problem is that the next_posts_link() function does not return the correct URL.** URL FOR THE BLOG PAGE USING MY PORTFOLIO'S LAYOUT: "test.mysite.com/blog.php" DESIRED "NEXT PAGE" URL (ASSUME THIS WORKS): "test.mysite.com/blog.php?paged=2" URL CURRENTLY RETURNED (DO NOT WANT!): "test.mysite.com/blog/.php?paged=2" URL OF THE DEFAULT WORDPRESS BLOG (WHICH I DON'T WANT USERS TO EVER SEE BECAUSE I WANT THEM TO SEE): "test.mysite.com/blog/" **How do I change the URL returned?** I think my lack of fluency in WordPress, PHP, and regular expressions is making this much harder than it should be for me. Also, I will probably need to change the previous_posts_link() URL too.


title: How to validate select field in post meta?

text: I want to display a select dropdown field in the post meta. How can I validate the input before saving it? Currently, I am simply saving without validating like this:               if ( isset( $_POST['select_meta'] ) ) {                  update_post_meta( $post->ID, 'select_meta', $_POST['select_meta'] );             }      Here's the code I'm using to display the meta field:               $select_items = ('one', 'two', 'three');          $select_meta = get_post_meta( $post->ID, 'select_meta', true ); ?>          <select id="select_meta" name="select_meta">         <?php             if($select_items){                 foreach ($select_items as $item){?>                     <option <?php selected( $item == $select_meta ); ?> value="<?php echo $item; ?>"><?php echo $item ?></option>                                                <?php                                    }             }         ?>           </select>


title: Show content of other domain inside WordPress

text: I'm very new to WordPress, to any kind of Web-Hosting, actually, so my question might be strange or stupid. I apologize in advance. ;) I recently started to set up the infrastructure for a small project, I'll be working on. It needs a blog (WordPress) and a project management tool (Redmine) and both should blend in as good as possible - especially domain- wise (I'm also trying to get the themes to be similar but lets see how that works out...). I found a hoster for the domain and Wordpress and another for Redmine. It is pretty easy to set up Wordpress at _blog.example.com_ and create a CNAME Record for _redmine.example.org_ which allows the user to feel like staying within the same domain when going from the blog to project management. But it would be even nicer, if I could create a page in WordPress which shows the content of _redmine.example.org_. Then the user would still see the menu, the feeds and whatever else I setup in Wordpress. Is that even possible? I googled a lot but found nothing. Thanks in Advance!


title: Colecting values from custom field checkboxes and displaying them in the post

text:
Ok, i have a form and a input fields type checkboxes. But in the post appears only the last value, what can be the reason?                Extras        <input type="checkbox" name="extras" value="ABS">Anti blocking system
       <input type="checkbox" name="extras" value="DRS"> Dynamic rear spoiler
       <input type="checkbox" name="extras" value="VSP"> Vibrating selfesteen system          <?php      $extras = $_POST['extras'];           add_post_meta($pid, 'extras', $extras, true);           //this is in the attempt to be displayed in the post           $extras = get_post_meta($post->ID, 'extras', false);                  if ($extras) {                     echo '
';                         foreach($extras as $extra){                             echo '
' . $extra . '
';                         }                     echo '
';                     }                     ?>


title: Avoiding stripping of HTML in Custom Taxonomy Meta Field

text: I'm using a custom form field on a Custom Taxonomy to hold various data. All working well except in one particular case where I'm trying to save an iframe embed code (from Bandcamp) which is to be echoed in a template later. Wordpress is inserting \ before any " in the output. I've tried using `htmlspecialchars` on my output, I've also added that to the value of my edit form field action. I guess I'm missing part of the process somewhere, perhaps on save? Save function is:               function save_taxonomy_custom_meta_bandcamp_embed_music( $term_id ) {         if ( isset( $_POST['term_meta'] ) ) {             $t_id = $term_id;             $term_meta = get_option( "taxonomy_$t_id" );             $cat_keys = array_keys( $_POST['term_meta'] );             foreach ( $cat_keys as $key ) {                 if ( isset ( $_POST['term_meta'][$key] ) ) {                     $term_meta[$key] = $_POST['term_meta'][$key];                 }             }             // Save the option array.             update_option( "taxonomy_$t_id", $term_meta );         }     }       add_action( 'edited_hhie_artists', 'save_taxonomy_custom_meta_bandcamp_embed_music', 10, 2 );       add_action( 'create_hhie_artists', 'save_taxonomy_custom_meta_bandcamp_embed_music', 10, 2 );


title: Getting commenter meta

text: I want to find out gender of commenter and based on that, assign a display picture of commenter who don't have any picture, based on their gender, i.e if a male commenter has no picture, it should assign it a male avatar. I have. I am unable to find ways to query gender.How can i make something like that? And where should i hook it in?


title: Custom field with image and figcaption

text:
Is it possible to create a custom field with both image and figure caption? I'm looking to add a custom field to the admin so users can include an image with a caption, styled as such:

Caption caption caption

      I've found resources on a custom image field - but cannot figure out how to tie the figure caption to it. Can anyone point me in the right direction? OK - I figured it out: I used the featured image field already native to wordpress. Then, in my functions.php file I added:                  add_theme_support( 'post-thumbnails' );          // this ads the featured image support to your theme              the_post_thumbnail('full');          // this sets the thumbnails to full size (no cropping)      Then, in my page.php file I added: post_excerpt) { echo '' . get_post(get_post_thumbnail_id())->post_excerpt . ''; } ?> This checks if there is a thumbnail. If so, it grabs it and posts it to the page and then grabs the caption if there is one (I guess it looks at a caption like an excerpt). Not sure if this is the best way to achieve what I wanted to do, but it seems to work so I'm moving on.


title: Show TwentyEleven header image only on home page

text: i am trying to remove the header from one page (actually all the pages exept the Home page) i did some research i found this code #post-xx .entry- title{display:none;} whereas the xx is the page ID . but it doesn t work for me do you know the exact code and exact place (and what s the page ID), or any other way... any help would be appreciated my website www.danielbelseamusic.com thanks a lot,daniel


title: Can I use get_term_children to show child terms if they exist and show something else if they don't?

text: I have a hierarchical custom taxonomy called taxon... In my taxonomy.php I am showing children of the current taxon, if you click one of those children you should be taken to a page showing all of that child taxon's products. Parent taxons never have products so its just a navigation structure.                   $term_id = $term->term_id;          $taxonomyName = "taxons";         $term_taxons = get_term_children($term_id, $taxonomyName);         if ($term_taxons != null) { ?>                     Show Child Taxons                 <?php } else { ?>                     SHOW PRODUCTS                 <?php } ?>      This does not work. I have tried running the it like if $term_taxons == null then do something else something else and that doesn't work either...


title: Strip Paragraph Tag

text: In my image.php I am using this code to grab the image caption of each image. The problem is a paragraph tag ( `<p>` ) is being added around it and I don't want one to be. Could somebody tell me how to strip this tag?               <?php if ( !empty($post->post_excerpt) ) the_excerpt(); ?>


title: Show the page title on blog page

text:
I created a page for my posts, and a home.php for the structure. I would like to show the page's name on the top of the posts, but the result is always the latest post. My code:               <?php get_header(); ?>
         <?php the_title(); ?>         <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>

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

by <?php the_author_posts_link(); ?> on <a href="<?php the_permalink(); ?>"><?php the_time( 'l F d, Y'); ?>
                 <?php the_content('Read More...'); ?>
         <?php endwhile; else: ?>
<?php _e('No posts were found. Sorry!'); ?>
         <?php endif; ?>

     ￼￼        <?php previous_posts_link('Previous'); ?> / <?php               next_posts_link('Next'); ?>

          <?php get_sidebar(); ?>          <?php get_footer(); ?>      Where's the problem? Is it possible to show the page's name on the blog page?


title: Right way to include blog-header.php?

text: I have a voting system on a custom post which uses AJAX, and I have a file that handles the AJAX request. This file is inside a sub folder named `php` of my theme. Hence the structure is: > ../wp-content/themes/my-theme/php/ajax-handler.php I use the following line to include the `blog-header.php` file: `include('../../../../wp-blog-header.php');` This works fine, but with debug mode on, I see warnings telling me that WP failed to open the stream as the file `blog-header.php` is non-existent. So I tried this: `define('WP_USE_THEMES', false);` `require('../../../../wp-blog-header.php');` Warnings gone, but $wpdb not recognized. Any ideas on how to make this work without the warnings?


title: HTTP Error 403 When Trying to Login

text: I'm currently trying to log into a WordPress website, which I downloaded off the virtual server, now in my local server (MAMP, because I'm on a Mac machine). When I try and log into the backend, it successfully gives me the WordPress login screen. After I log in with the correct credentials, it gives me the following: > Error 403 > > We're sorry, but we could not fulfill your request for /wp-login.php on this > server. > > You do not have permission to access this server. Data may not be posted > from offsite forms. > > Your technical support key is: _key number_ > > You can use this key to fix this problem yourself. > > If you are unable to fix the problem yourself, please contact wiley at > illinimedia.com and be sure to provide the technical support key shown > above. One of the plugins we use on this site is Bad Behavior, which I believe is the cause of the problem. So, I looked up different support posts, such as:   * this one   * and this one I've tried removing the bad behavior folder out of the plugin folder, "deactivating" the plugin. Then, I restarted my Apache server. But no luck. Is there something else that I could be trying? Thanks in advance!


title: How to implement custom search with input fields?

text: I want to implement a search form like this: Loan Form In my theme I have a custom post type called Data with the Year and Money custom fields. I googled a lot but can't find a way to submit the user inputs to a place from where I can use `WP_Query` to populate the search result. So, how to take user input from a form and use it to create a result page in WordPress? And also please someone explain how the WordPress `?s=` query works.


title: Get filenames of available image sizes

text: Example: /wp-content/uploads/2013/11/xyz.jpg This has 2 other thumbnail images that were created with it.. /wp-content/uploads/2013/11/xyz-150x150.jpg   /wp-content/uploads/2013/11/xyz-201x300.jpg How do you get the filenames of these other images from the post id or the original image src?


title: How to setup a product that has multiple price options?

text: Still very new to the Woocommerce interface. I'm trying to figure out how to sell 'attendance' to a workshop. So I'm assuming I need to create a 'variable product' and then I need to add the following 2 price options:   * 1 attendant: $125   * 2 attendants: $195 The gateway is paypal > WooCommerce version 1.6.5.1 > > WordPress version WP 3.4.1


title: Form Submission Warning: Cannot modify header error only when plugin is deactivated

text: I have created some custom post forms that I'm now using in place of a plugin called WP User Frontend which allows you to post and edit from front end. These post forms we're working great but when I deactivated the plugin I now I get a warning when the post completes its' upload saying.. Warning: Cannot modify header information - headers already sent by (output started at /home/####/public_html/#####/wp-content/themes/####/header- default.php:2) in /home/#####/public_html/#####/wp-includes/pluggable.php on line 881. Now I checked for white spaces and I honestly don't see any in the header, page template, or footer and I don't believe it has anything to with that because the post forms work fine when the plugin is activated. I'm also using buddypress which has a form submit for avatars and that works fine without plugin activated so I'm thinking my form has something missing that the plugin was providing. Instead of pasting the entire code including the html form I'm going to show the php part of the template that does the work.               <?php// Template Name: Album Post Form ?>     <?php get_header(); ?>          <?php if( 'POST' == $_SERVER['REQUEST_METHOD'] && !empty( $_POST['action'] ) &&  $_POST['action'] == "new_post") {     if ( ! function_exists( 'wp_handle_upload' )) {                 require_once(ABSPATH . "wp-admin" . '/includes/image.php');                 require_once(ABSPATH . "wp-admin" . '/includes/file.php');                 require_once(ABSPATH . "wp-admin" . '/includes/media.php');     }     $file=$_FILES;     // Do some minor form validation to make sure there is content     if (isset ($_POST['title'])) {         $title =  $_POST['title'];     } else {         echo 'Please enter a game  title';     }     if (isset ($_POST['description'])) {         $description = $_POST['description'];     } else {         echo 'Please enter the content';     }     $tags = $_POST['post_tags'];          // Add the content of the form to $post as an array     $new_post = array(         'post_title'    => $title,         'post_content'  => $description,         'tags_input'    => array($tags),         'post_status'   => 'publish',           // Choose: publish, preview, future, draft, etc.         'post_type' => fod_albums  // Use a custom post type if you want to     );     //save the new post and return its ID     $pid = wp_insert_post($new_post);     if (!($file['album_image']['name'] == "")) {       $cover_art_id = media_handle_sideload( $file['album_image'], $pid );       if ( is_wp_error($cover_art_id) ) {         @unlink($file_array['tmp_name']);         return $cover_art_id;       }       if(!is_wp_error($cover_art_id)){        wp_set_object_terms( $cover_art_id, 'cover_art', 'category');       }       update_post_meta($pid,'album_cover',$cover_art_id);     } elseif ($file['album_image']['name'] == "" && !($_POST['cover_radio'] == '')) {       update_post_meta($pid,'music_art',$_POST['cover_radio']);     }     wp_redirect( get_permalink($pid));      exit();     }      do_action('wp_insert_post', 'wp_insert_post');     ?>      Any ideas?


title: Retrieving Google Plus share count with wp_remote_post

text: So I've spent most of my morning working on my website's customized social share buttons. Reading out Twitter and Facebook shares were no problem, but Google Plus is a real challenge, as they don't offer an easy-to-use GET API. I found a working technique using barebones CURL ( http://www.tomanthony.co.uk/blog/google_plus_one_button_seo_count_api/comment- page-1/ ). But previously, I've tried hard to get it to work with Wordpress' functions like wp_remote_post and failed. Anyone can tell me what I've been doing wrong? Here is what I managed to get together. Two different requests fail:               $google_url = 'https://clients6.google.com/rpc?key=AIzaSyCKSbrvQasunBoV16zDH9R33D88CeLr9gQ';     $headers    = array('Content-type' => 'application/json');     $body       = array( "method"   => "pos.plusones.get"                         ,"id"       => "p"                         ,"params"   => array(   "nolog"     => true                                                 ,"id"       => $url                                                 ,"source"   => "widget"                                                 ,"userId"   => "@viewer"                                                 ,"groupId"  => "@self"                                             )                         ,"jsonrpc"  =>"2.0"                         ,"key"      => "p"                         ,"apiVersion" => "v1"                     );          $response = wp_remote_post( $google_url , array( 'method'   => 'POST'                                                     ,'headers'  => $headers                                                     ,'body'     => $body    ) );          if (!is_wp_error($response)) {         $resp = json_decode($response['body'],true);         _e($response['body']);     }     else     {         _e('error');     }     // Another attempt to get data with WP_Http      $request = new WP_Http;     $result = $request->request( $google_url , array( 'method' => 'POST', 'body' => $body, 'headers' => $headers ) );          if (!is_wp_error($result)) {         $resp = json_decode($result['body'],true);         _e($result['body']);     }     else     {         _e('error AGAIN');     }      PS: The API key is a public one for developers.


title: The "_encloseme" Meta-Key Conundrum

text:
While working with metaboxes / custom fields I've seemed to indirectly create many of these _encloseme meta_keys all over my wp_postmeta. Seen here: ![](http://i.imgur.com/a9aTo.png) So far no problems have arisen from this and the custom fields work fine but I've only fidgeted with 2 or so posts on my local test site and I don't want to implement it to my live site if its going to cause issues later on down the road. Anyone know what to do about these, are they normal? Here's the code for my metaboxes.               <?php              //Add meta boxes to post types         function plib_add_box() {             global $meta_box;                  foreach($meta_box as $post_type => $value) {                 add_meta_box($value['id'], $value['title'], 'plib_format_box', $post_type, $value['context'], $value['priority']);             }         }         //Formatting         function plib_format_box() {           global $meta_box, $post;                // verification           echo '<input type="hidden" name="plib_meta_box_nonce" value="', wp_create_nonce(basename(__FILE__)), '" />';                echo '
';                foreach ($meta_box[$post->post_type]['fields'] as $field) {               // get current post meta data               $meta = get_post_meta($post->ID, $field['id'], true);                    echo '
'.                       ''. $field['name']. '	'.                       '';               switch ($field['type']) {                   case 'text':                       echo '<input type="text" name="'. $field['id']. '" id="'. $field['id'] .'" value="'. ($meta ? $meta : $field['default']) . '" size="30" style="width:97%" />'. '
'. $field['desc'];                       break;                   case 'textarea':                       echo '<textarea name="'. $field['id']. '" id="'. $field['id']. '" cols="60" rows="4" style="width:97%">'. ($meta ? $meta : $field['default']) . '</textarea>'. '
'. $field['desc'];                       break;                   case 'select':                       echo '<select name="'. $field['id'] . '" id="'. $field['id'] . '">';                       foreach ($field['options'] as $option) {                           echo '<option '. ( $meta == $option ? ' selected="selected"' : '' ) . '>'. $option . '</option>';                       }                       echo '</select>';                       break;                   case 'radio':                       foreach ($field['options'] as $option) {                           echo '<input type="radio" name="' . $field['id'] . '" value="' . $option['value'] . '"' . ( $meta == $option['value'] ? ' checked="checked"' : '' ) . ' />' . $option['name'];                       }                       break;                   case 'checkbox':                       echo '<input type="checkbox" name="' . $field['id'] . '" id="' . $field['id'] . '"' . ( $meta ? ' checked="checked"' : '' ) . ' />';                       break;               }               echo     ''.'
';           }                echo '
';              }         // Save data from meta box         function plib_save_data($post_id) {             global $meta_box,  $post;                  //Verify             if (!wp_verify_nonce($_POST['plib_meta_box_nonce'], basename(__FILE__))) {                 return $post_id;             }                  //Check > autosave             if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {                 return $post_id;             }                  //Check > permissions             if ('page' == $_POST['post_type']) {                 if (!current_user_can('edit_page', $post_id)) {                     return $post_id;                 }             } elseif (!current_user_can('edit_post', $post_id)) {                 return $post_id;             }                  foreach ($meta_box[$post->post_type]['fields'] as $field) {                 $old = get_post_meta($post_id, $field['id'], true);                 $new = $_POST[$field['id']];                      if ($new && $new != $old) {                     update_post_meta($post_id, $field['id'], $new);                 } elseif ('' == $new && $old) {                     delete_post_meta($post_id, $field['id'], $old);                 }             }         }              add_action('save_post', 'plib_save_data');              //We create an array called $meta_box and set the array key to the relevant post type     // If custom post type, change the 'post' variable         $meta_box['post'] = array(                  //This is the id applied to the meta box             'id' => 'venue_location',                    //This is the title that appears on the meta box container             'title' => 'Venue/Location',                      //This defines the part of the page where the edit screen section should be shown             'context' => 'normal',                      //This sets the priority within the context where the boxes should show             'priority' => 'high',                  //Here we define all the fields we want in the meta box             'fields' => array(                 array(                     'name' => 'Venue',                     'desc' => 'Venue Name',                     'id' => 'venue_info',                     'type' => 'text',                     'default' => ''                 ),                 array(                     'name' => 'Location',                     'desc' => 'Location of the Venue',                     'id' => 'location_info',                     'type' => 'text',                     'default' => ''                 )             )         );         add_action('admin_menu', 'plib_add_box');     ?>      (Just incase, here's a pastbin link to the above code: http://pastebin.com/0QsqxtZW)


title: Why do previews work in one browser, but not another?

text: I keep having an intermittent issue where the admin bar disappears from a wordpress site I often use, when using my main browser (Google Chrome). I can access /wp-admin/ no problem, and another problem is that post previews will not work, instead showing me the 404 page. Safari, however, works just fine. What can I do to get Chrome to behave properly again?


title: Help with multisite redirect issues using Cherokee OR solid nginx config?

text: A little background: We've decided to abandon Apache because it can't keep up with the demand we're putting on it. We have a cron script that will create a new post about once every 3 or 4 seconds containing a product. This puts a huge memory strain on the system, and even the top VPS option with Godaddy can't handle it. We've decided to not only abandon Apache, but start fresh and move everything to a cloud solution using profitbricks.com. One of the first steps was to decide on a webserver, and we found nginx. Nginx has a lot of positive reviews, and has a growing userbase. I was able to set everything up and get it working on the new server. The posts were created at a rate of one/3seconds, main site was snappy, and not even a performance blip with the server. The trouble was that all of the sub-directory sites took minutes to load. Not acceptable. Now I'm looking into Cherokee as the webserver. And having another issue, the main page is snappy, but this time, the sub-sites won't even load. It gives a 404 error. This tells me the rewrite rules are wrong. (now here's the potential deal breaker with Cherokee...) The only documentation I can find about how to set up WPMS using subdirectories is 3 years old and is way out- dated. I've been on this for a couple weeks now, and I'm starting to feel some pressure, b/c I need to get this website back online ASAP. So here's my question: Can anybody help me to put together a stable, fast NGINX configuration OR can anyone help me to translate the multisite .htaccess rewrite rules into something that will work with the current stable version of Cherokee? Please help if you are able. :) -Chase Here's my current nginx config:               map $uri $blogname{         ~^(?<blogpath>/[^/]+/)files/(.*)    $blogpath ;     }          map $blogname $blogid{         default 0;         #include /var/www/example.com/htdocs/wp-content/plugins/nginx-helper/map.conf;         #Add list of blogs with their ids. SEE "FILE-HANDLING" SECTION.         /site1/ 2;         /site2/ 3;     }     server {         server_name example.com www.example.com ;              access_log   /var/log/nginx/example.com.access.log;         error_log    /var/log/nginx/example.com.error.log;              root /var/www/example.com/htdocs;         index index.php;              location ~ ^/files/(.*)$ {               try_files /wp-content/blogs.dir/$blogid/$uri /wp-includes/ms-files.php?file=$1 ;               access_log off; log_not_found off; expires max;         }              #avoid php readfile()         location ^~ /blogs.dir {             internal;             alias /var/www/example.com/htdocs/wp-content/blogs.dir ;             access_log off; log_not_found off;  expires max;         }              if (!-e $request_filename) {             # wp-admin to wp-admin/             rewrite /wp-admin$ $scheme://$host$uri/ permanent;               #other wp-* files/folders             rewrite ^(/[^/]+)?(/wp-.*) $2 last;              #other php files             rewrite ^(/[^/]+)?(/.*\.php) $2 last;          }              location / {             try_files $uri $uri/ /index.php?$args ;         }              location ~ \.php$ {             try_files $uri /index.php;             include fastcgi_params;             fastcgi_pass unix:/var/run/php5-fpm.sock;         }              location ~* ^.+\.(ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|rss|atom|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf)$ {             access_log off; log_not_found off; expires max;         }              location = /favicon.php { access_log off; log_not_found off; }         location = /robots.txt { access_log off; log_not_found off; }         location ~ /\. { deny  all; access_log off; log_not_found off; }     }      And a layout of the rules I found for Cherokee: 1 - Rule Type: Regular Expression: Rule:                   Regular Expression: ^/.*files.*$          Handler:              Redirection - Regular Expression: ^/(.*)files/(.*) to Substitution: /wp-content.php?file=$2      2 - Rule Type: Complex: Rule:                   Regular Expression: ^/([_0-9a-zA-Z-]+)/(wp-.*|.*\.php(\?.*|))$ AND         Not ( File Exists, Match any file, disabled all the other checkboxes )          Handler: Redirection, 2 lines:              Type Internal, Regular Expression: ^/([_0-9a-zA-Z-]+)/(wp-.*)$ to Substitution: /$2         Type Internal, Regular Expression: ^/([_0-9a-zA-Z-]+)/(.*\.php(\?.*|))$ to Substitution: /$2      3 - Rule Type: Regular Expression: Rule:                   Regular Expression: ^/(.*)\.php(\?.*|)$          Handler:              FastCGI, Information source: PHP Interpreter. All options left as default.      4 - Rule Type: Complex Rule:                   Regular Expression: ^(.*)$ AND         NOT ( File Exists, Match any file, disabled all the other checkboxes )          Handler:              Redirection: Internal, Regular Expression: ^/(.*)$ to Substitution: /index.php      Thanks so much for any help!


title: Why am I getting blank thumbnails in media library?

text: I run a Multisite installation with 10 blogs. All the other blogs work fine except for one where any image that's uploaded does not show up in the media library. There's just a blank image instead of the usual thumbnail. Clicking on "Edit" brings you to the "Edit Media" page, but NO image is displayed. Copying the file URL in the "Save" area on the right side of the "Edit Media" page and pasting it into the browser address bar DOES show the image. Clicking "View" from the "Media Library" brings you to a page, but NO image is displayed. I can't figure this out because this blog was installed the same way the others were. I have made sure that:   1. File permissions are set to 755 on all folders and files   2. The images are uploading to the correct folder wp-content/uploads/sites/"site folder"/"year"/"month"   3. Deactivated all plugins and reactivated each one to see if any are causing issues   4. Uninstalled and reinstalled the particular blog. The only thing I haven't tried was doing something in the database directly, but don't know where to start. Any help with this would be fantastic. Thanks.


title: Get page type to display content

text: I have some checkboxes to select where can I display my plugin and I save in db in this format: Show popup in this pages: x Article (Public) x Pages (Public) x File (Public) x Revisions (Not public) Those settings I save in db in this format: So if i CHECKED to show popup in post and pages i have               a:2:{i:0;s:4:"post";i:1;s:4:"page";}      How to add some filters or to check when to display content? Something like:               if(in_array(current_page, my_array_with_accepted_pages)) show something      or just add some filters and the plugin will now where to display the content.


title: Open graph metadata isn't pulled on Facebook until after I run that specific link through the debugger

text: I added open graph meta data to all the posts on a site, however, when I attempt to paste a post link on Facebook, the graph meta information isn't loaded. Then, when I insert the URL into the debugger / linter, it works, both within the debugger and when posting normally on Facebook (which didn't work moments prior). This issue seems to have been addressed in the past, in this Stack Overflow question. However that question pertains to a Rails environment. In that question, the application couldn't handle multiple http requests at the same time. The issue was solved by handling all Facebook API requests in the background using something called delayed_response. What's the simplest fashion in which I could accomplish this or something similar in a PHP environment running Wordpress and thereby (hopefully) solve my problem? * _I didn't include a sample link in this post because as soon as a user runs it through the debugger, it'll appear to work._ Edit- Sample of meta tags from a post page:               <meta property="og:title" content="Budget proposal good news for Ontario drivers - AdvocateDaily.com" />     <meta property="og:type" content="website" />     <meta property="og:image" content="http://build.advocatedaily.com/wp-content/uploads/2013/04/Stacey-Stevens_Colour_NEW_2012-e1354206636925-150x150.jpg" />     <meta property="og:url" content="http://advocatedaily.com/2013/05/budget-proposal-good-news-for-ontario-drivers/" />     <meta property="og:description" content="A provincial budget proposal to reduce auto insurance premiums by an average of 15 per cent is good news for Ontario drivers, but should not come at the cost of benefits available under the policy, says Toronto personal injury lawyer Stacey L. Stevens. “In response to this announcement, the Insurance Bureau of Canada (IBC) predicts the [...]" />     <meta property="og:site_name" content="Advocate Daily" />      The PHP being inserted into wp_head:               add_action('wp_head', 'add_fb_open_graph_tags');     function add_fb_open_graph_tags() {         if (is_single()) {             global $post;             if(get_the_post_thumbnail($post->ID, 'thumbnail')) {                 $thumbnail_id = get_post_thumbnail_id($post->ID);                 $thumbnail_object = get_post($thumbnail_id);                 $image = $thumbnail_object->guid;             } else {                 $image = get_template_directory_uri()."/images/advocatedaily-avatar.png";             }             //$description = get_bloginfo('description');             $description = og_excerpt( $post->post_content, $post->post_excerpt );             $description = strip_tags($description);             $description = str_replace("\"", "'", $description);     ?>     <meta property="og:title" content="<?php the_title(); ?> - AdvocateDaily.com" />     <meta property="og:type" content="website" />     <meta property="og:image" content="<?php echo $image; ?>" />     <meta property="og:url" content="<?php the_permalink(); ?>" />     <meta property="og:description" content="<?php echo $description ?>" />     <meta property="og:site_name" content="<?php echo get_bloginfo('name'); ?>" />     <?php   }     }     function og_excerpt($text, $excerpt){         if ($excerpt) return $excerpt;         $text = strip_shortcodes( $text );         $text = apply_filters('the_content', $text);         $text = str_replace(']]>', ']]>', $text);         $text = strip_tags($text);         $excerpt_length = apply_filters('excerpt_length', 55);         $excerpt_more = apply_filters('excerpt_more', ' ' . '[...]');         $words = preg_split("/[\n          ]+/", $text, $excerpt_length + 1, PREG_SPLIT_NO_EMPTY);         if ( count($words) > $excerpt_length ) {                 array_pop($words);                 $text = implode(' ', $words);                 $text = $text . $excerpt_more;         } else {                 $text = implode(' ', $words);         }         return apply_filters('wp_trim_excerpt', $text, $raw_excerpt);     }


title: Filtering get_permalink in Jetpack / ShareDaddy

text: I recently changed my permalink structure from `/YYYY/MM/%post_name%/` to `/%post_name%/`, and lost my tweet counts and likes (provided by Jetpack) in the process. To fix this, I want Jetpack to use the old-style permalinks for stories dated prior to the change. Unfortunately, it looks like I'll have to filter the content of `get_permalink` to do it. So I have my function to return the fixed permalinks:               function jetpack_sharing_permalink( $permalink, $post, $leavename ) {              $url_change_date = strtotime( "23 February 2013" ); // Date of the URL changeover         $post_date = get_the_time( 'U', $post->ID );              if ( $post_date < $url_change_date ) :             $url_date_prefix = "/" . date( "Y", $post_date ) . "/" . date( "m", $post_date );             $permalink = str_replace( get_site_url(), get_site_url() . $url_date_prefix, $permalink );         endif;              return $permalink;          }        1. How do I use it to filter the output of `get_permalink`? Is my theme's `functions.php` too late?   2. How would I get started writing a 'baby' plugin (as suggested) so that `get_permalink` is only filtered for Jetpack's Sharing feature? Thanks in advance.


title: Query category-specific, paginated posts and allow viewer to change sort order

text:
Maybe this has already been asked here, but I can't seem to find a solution, so forgive me if this is a duplicate. I have coded a custom template to display all posts from a category with the ID 36. I would then like to provide the viewer with the option to sort the displayed posts either alphabetically or chronologically. Everything is working fine - the posts are displaying correctly and are paginated - but I can't get the sorting links to work. Some help with this would be GREATLY appreciated!

                 <?php $sort= $_GET['sort'];                     if($sort == "title")                     {                     $order= "orderby=title";                     }                     if($sort == "date")                     {                     $order= "orderby=date";                     }                 ?>
My Headline

My sub-headline.
                 Sort by Title                 Sort by Date

                 <?php                      $temp = $wp_query;                      $wp_query = null;                      $wp_query = new WP_Query();                      $wp_query->query('cat=36&posts_per_page=6'.'&paged='.$paged.$order.'&order=DEC');                  ?>                 <?php while ($wp_query->have_posts()) : $wp_query->the_post(); ?>                 <?php $url = wp_get_attachment_url( get_post_thumbnail_id($post->ID) );?>
                         <a href="<?php the_permalink(); ?>">

                             <img src="<?php echo $url; ?>" class="video_image"/>
                             <a href="<?php the_permalink(); ?>" class="video_title"><?php the_title(); ?>
                             <?php the_date(); ?>

<?php the_excerpt(); ?>
                         <a href="<?php the_permalink(); ?>" class="watch_video">Watch Video >
                 <?php endwhile; ?>

                 <?php posts_nav_link( ' ', '', '' ); ?>                 <?php                      $wp_query = null;                      $wp_query = $temp;                 ?>

      I should add that PHP and Wordpress are not my areas of specialty, so any other input you may have about my above code is also more than welcome. Thank you!


title: wp_upload_bits does not retrieve images that do not have an extension

text: I am using the following code to retrieve images from the web:               $get = wp_remote_get($image_file_name);     $mirror = wp_upload_bits(basename($image_file_name), '', wp_remote_retrieve_body($get));      This code works just fine with all sorts of images except when images have no extension. For example, if image file name was:               http://www.some_site.com/image_filename.jpg      then running the above code would be ok. However, the link               http://www.some_site.com/another_image_filename_but_without_extension      would give the following error:               Array     (         [error] => Invalid file type     )      After further investigation, it looks like wp_upload_bits has the following code in it:               $wp_filetype = wp_check_filetype( $name );     if ( ! $wp_filetype['ext'] && ! current_user_can( 'unfiltered_upload' ) )         return array( 'error' => __( 'Invalid file type' ) );      And it seems that it is checking if an extension actually exists, and if not, then there is an error. So my question is how do I work around this to download images that do not have extensions? Thanks.


title: Only let plugin add actions to wp_head & wp_footer on single posts

text: I'm using a a plugin (Comments Evolved) on a recently built site. The issue I'm having is that this plugin globally enqueueing and adding actions to the head and footer of all pages. I'd like to remove the actions except for single posts only. I tried this in my `functions.php` file:                   // strip out the plugin junk slowing down pages it's not used on         function strip_the_junk() {             if (!is_single() {                 remove_action('wp_head', 'gplus_comments_enqueue_styles');                 remove_action('wp_footer', 'gplus_comments_enqueue_scripts');             }         )};         add_action('wp_enqueue_scripts', 'strip_the_junk', 11);      That crashes my site. For Comments Evolved, this is what's being pumped in by `hook.php`:                   function gplus_comments_enqueue_styles()         {           wp_enqueue_style('gplus_comments_tabs_css');         }         add_action('wp_head', 'gplus_comments_enqueue_styles', 4269);              function gplus_comments_enqueue_scripts()         {           print "\n<script>jQuery('#comment-tabs').tabs();</script>\n";         /*         <script type="text/javascript">           (function() {            var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;            po.src = 'https://apis.google.com/js/client:plusone.js';            var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);           })();         </script>         */         }         add_action('wp_footer', 'gplus_comments_enqueue_scripts', 4269);      Any thoughts on where I'm going wrong with this? Thanks!


title: Migrating Wordpress blog to New Webhosts, something is adding a # and gibberish

text: I just migrated a WordPress blog from one host provider to another. Did a clean install on the new server, and everything seems to be working fine except all the permalinks for some reason add a string on the end like this: http://keefermadness.com/2011/09/behind-the-scenes-of-my-nasa-grail- experience-day-one-am#.Tpq5DpzpP-g That #.Tpq5DpzpP-g shouldn't be there. Any idea where this is coming from and how to eliminate it? Thanks, Ryan


title: Reasonable Size Limit to options entry

text: I have a set of ~4700 records that I need to have locally searchable for my plugin via an auto-complete (it's the Google Product Search categories). Would it be okay to store this data in the options table as an array or would it be better to actually create a separate table in which to store this data? It's about 317k. Would I be asking for trouble if I just stored it as an array in the options table? Does each page load cache all the site options?


title: Get second level terms of custom taxonomy

text: I want to get second level terms of a specific parent (first-level) term in a custom taxonomy. Sounds complicated but would be useful.               Term 1        SubTerm-1.1        SubTerm-1.2            SubTerm-1.2.1     Term 2        SubTerm-2.1      Say, if `SubTerm->parent` is Term 1's id, then i want to output SubTerm 1.1 and 1.2 but not 1.2.1. `wp_list_categories(array('depth' => 2, 'taxonomy' => 'customtax'));` is not i'm looking for as it lists terms with their links, which i dont want to, and there is no filtering option by `SubTerm->parent` id. So any idea?


title: Load JavaScript from a post that's loading into Fancybox via ajax

text: I'm hoping this makes sense. When a user clicks on a post title I'm launching a modal overlay via fancybox, and feeding the associated post content via ajax. However I have a javascript call function that I need to run that is from the post that isn't running when the content is pulled. I have a guess the it has something to do with $(document).ready(function() Any ideas? How to I load this function after the modal overlay has been triggered?               <script type="text/javascript">     $(document).ready(function(){       $("#jquery_jplayer_1").jPlayer({         ready: function () {           $(this).jPlayer("setMedia", {             m4v: "http://www.jplayer.org/video/m4v/Big_Buck_Bunny_Trailer_480x270_h264aac.m4v",             ogv: "http://www.jplayer.org/video/ogv/Big_Buck_Bunny_Trailer_480x270.ogv",             poster: "http://www.jplayer.org/video/poster/Big_Buck_Bunny_Trailer_480x270.png"           });         },         swfPath: "/js",         supplied: "m4v, ogv",                             size: {                          width: "850px",                          height: "438px"                     }       });     });     </script>


title: If in category to be inside of a function

text: I have this code in WordPress **index.php** and I was wondering how can I transfer this in to a **functions.php** to be a part of a **function**?               <?php if (in_category('featured')) : ?>     <a href="<?php the_permalink(); ?>">            <img src="<?php bloginfo('template_directory'); ?>/images/featured_icon.png" />                                 <?php endif; ?>      Thank You in advance for Your help :)


title: Can I change default registration link (without htaccess)?

text: I'm using url like «wp-login.php?action=register&role=patient» and «register_form» hook for add extra inputs form which depends on urls like this:               add_action('register_form','add_extra_role_fields');          function add_extra_role_fields() {     if (isset($_GET['role'])) { $user_type = $_GET['role']; }          if (isset($user_type) && $user_type == "patient") [...]      if (isset($user_type) && $user_type == "doctor") [...]      **Problem** : Wordpress redirects user after form validation with error to http://example.com/wp-login.php?action=register instead of http://example.com/wp-login.php?action=register&role=patient and all logic is broken. **Question** : Can wordpress redirect user to previos url «?action=register&role=doctor» (not default «?action=register») ? **Solution** : Thank you Jan Fabry :).               if ( isset($_REQUEST['role']) && ( ($_REQUEST['role'] == 'patient') OR ($_REQUEST['role'] == 'doctor') ) ) {              add_filter( 'site_url', 'doctor_site_url', 10, 4 );               function doctor_site_url( $url, $path, $scheme, $blog_id ) {             if ( 'login_post' == $scheme ) {                 $url .= '&role='.$_REQUEST['role'];                 }             return $url;             }     }


title: Updating the Drag-To-Share eXtended share URLs?

text: How can I update the URLs that Drag-To-Share eXtended generates? At least in version 1.13, sharing items for Twitter and Facebook does not produce the proper url string for actually sharing the content on either network. Facebook, Twitter, and possibly other networks have since changed the url query string methods for sharing... This would require a quick update to the plugin so it writes up-to-date urls, but I don't know where to look.


title: The best way to write an FAQ page?

text: Maybe a plugin is required I have a faq page that is likely to gross more then 50 questions and will need to be regularly modified and maintained. I would like to write a title (possibly marked as header6,5 or 4) and the answer below it. What i want is a way to generate links at the top of the page with the heading as the link text. Whats the best/easiest way todo this? I was hoping maybe using MS word to generate the ToC for me and use it as an faq would work. Then i realize the ToC has no links. Maybe i can find something that generates html which i can copy/paste or something What is your suggestion for maintaining a large faq page?


title: How do I paginate posts page with $wpdb?

text: I am using this to get the posts:               (...) if ( empty( $categories_defined) ) {            $posts = get_posts($args);     } else {       global $wpdb;       $posts = $wpdb->get_results( $wpdb->prepare(         "SELECT * FROM $wpdb->posts WHERE         post_type = 'post' AND post_status = 'publish' AND         post_title LIKE %s  ORDER BY post_title ASC LIMIT 50",         $categories_defined . '%'       ) );     }       So I have already limited my posts, which is working fine, but I can't get the pagination. I tried using a plugin, shortcodes and the native pagination, but I can't find the problem. Can someone help me out with this? I'd like to have a `next` and `previous` pagination together with the navigation with numbers... One for above, one beneath the posts...


title: How to exclude posts of a certain format from the feed

text: I want to exclude posts from aside post-format in the feed. I have already checked up here about how to exclude posts from a certain post format from the loop but how to exclude posts from a post format in the feed? Couldn't modify it because I am not very good with the code.


title: Reading csv from specific directory and insert it to custom post type (cron job)

text: Need a comprehensive cron job script to read .csv data uploaded regularly to specific folder. Will insert data to custom post type only if csv exist base on cron job current date. Any suggestion of best script/plugin to read the csv? The script output must be easily modified to be insert to custom post type. Thanks. :-)


title: How to add "Stick this post to the front page" to front end?

text: I have a baseball related website with multiple authors. I use the "Stick this post to the front page" to denote an "Editor's Pick" on an article. I would like to add a link/button to allow editor to do this from the front end. The method can either be in the article itself or in the Admin Bar. I do not really have a preference. I have looked through many, many different "Admin Bar" plugins, but haven't been to find anything relating to "Stick this post to the front page". Thanks


title: Keyboard shortcut for headings on safari

text: When I use wordpress on PC, I can simply press ctrl+1 for Heading1 and ctrl+2 for heading 2... But when I use my mac it doesn't work. What are the shortcuts for heading styles on safari?