title: How to retrieve parent pages

text:
I have this pages and all are parent of Media:               Behind-The-Scenes: Commercial     "I KNEW YOU" BEHIND-THE-SCENES     RED Album Art     2012 - Rio de Janeiro, Brazil     SPEAK NOW EXHIBIT     2012 Australia/New Zealand Tour - Fan Photos     Charleston Photo Blog     Speak Now Album Art     Speak Now Tour - Fans!     Journal     Fun Photos     Album/Single Covers     Behind the Scenes     "Mine" Video Shoot     World Tour Live - Asia     Fearless Album Art      I am using this code to get all this pages but getting only 10 pages. Why?               $photos_id= 166; //Media page ID     $photos_wp_query = new WP_Query();     $par_wp_pages = $photos_wp_query->query(array('post_type' => 'page', 'post_parent'=>$photos_id, 'orderby'=>'title', 'order'=>'ASC' ));     for($i=0; $i<count($par_wp_pages); $i++){         ?> <a href="<?php echo get_page_link($par_wp_pages[$i]->ID); ?>"><?php echo $par_wp_pages[$i]->post_title; ?>
 <?php     }      Any ideas or suggestions? Thanks.


title: Query with no terms uses index.php template instead of archive.php

text: I'm using the Query Multiple Taxonomies plugin to get a page of search results (all of which are a custom post type - car). If any search terms are added, so the url looks like this:               http://mysite.com/car/?makemodel=ford&body=&gearbox=&fuel=&minprice=&maxprice=      then the archive.php template is used. However, if the user clicks search without adding any terms, so the url looks like this:               http://mysite.com/car/?makemodel=&body=&gearbox=&fuel=&minprice=&maxprice=      then index.php is used instead. I'd like to ensure this 'empty' search uses the archive.php template too. These bits from my functions file may be relevant:               // Ensure Custom Post Type is included in query          add_action( 'pre_get_posts', 'add_my_post_types_to_query' );          function add_my_post_types_to_query( $query ) {         if ( is_home() && $query->is_main_query() )             $query->set( 'post_type', array('car' ) );         return $query;     }               // Tweaks to taxonomy layered search          function my_qmt_base_url( $base ) {         return get_bloginfo('home').'/car/';     }     add_filter( 'qmt_base_url', 'my_qmt_base_url' );               function my_qmt_reset_url( $reset_url ) {         $url = get_permalink();         return $url;          }     add_filter( 'qmt_reset_url', 'my_qmt_reset_url' );      Any help would be much appreciated! Graham


title: How to use Yoast SEO backend in english even if WPLANG variable is not english?

text: I added this code to my functions.php file               add_filter('locale', 'wpse27056_setLocale');     function wpse27056_setLocale($locale) {         if ( is_admin() ) {             return 'en_US';         }              return $locale;     }      so the frontend is available in `ro_RO` and `wp-admin` is available in `en_US` Well... that almost worked excepting Yoast's WordPress SEO plugin which is translated in romanian. What can i do with that plugin to be displayed in english?


title: Custom taxonomy rewrite using tax name instead of rewrite slug

text: I Created a custom taxonomy for my `projects` custom post type.               function projects_taxonomy() {       $labels = array(         'name'              => __('projects Categories'),         'singular_name'     => __('project Category'),         'search_items'      => __('Search project Categories'),         'all_items'         => __('All project Categories'),         'parent_item'       => __('Parent project Category'),         'parent_item_colon' => __('Parent project Category:'),         'edit_item'         => __('Edit project Category'),          'update_item'       => __('Update project Category'),         'add_new_item'      => __('Add New project Category'),         'new_item_name'     => __('New project Category'),         'menu_name'         => __('project Categories'),         'rewrite' => array('slug' => 'projects', 'with_front' => true)       );       $args = array(         'labels' => $labels,         'hierarchical' => true,       );       register_taxonomy('projects-category', 'projects', $args);     }      The problem is the taxonomy rewrite is not working correctly and links to tax archive pages look like this:               http://www.domain.com/projects-category/first-cat/      instead of (what i expect):               http://www.domain.com/projects/first-cat/      I tried regenerating htaccess file through permalinks settings a few times. and also checked my syntax with wordpress codex and it seems okay. does it need to be enabled somehow?


title: What is a good plugin for making a template that can be reused to make several objects on a single page?

text: I'm looking for a plugin or an idea that would allow a user to add a mini-post to a page. Each post would contain a .pdf, and a mini description. I found Custom Field Template.. but I think once you fill it out once, you can't fill out another one for the same page. Thanks!


title: Trying to add script to specific admin page is not working

text: What I am trying to achieve is to load a .js file on an edit.php page, however the code is not working specifically for this page. I've applied the same code type of code to other CPT pages, but for some reason this CPT page is not registering the script. Here is the code I am using:               add_action( 'admin_menu', 'contacts_table_add_pages', 99 );     function contacts_table_add_pages(){         $menu = add_menu_page( 'Contacts', 'Contacts', 'publish_posts', 'edit.php?post_type=contact' );         $submenu = add_submenu_page('contacts', 'Add Contact', 'Add Contact', 'publish_posts', 'post-new.php?post_type=contact');              add_action( 'load-' . $menu, 'contacts_table_add_custom_css_js', 11 );     }          function contacts_table_add_custom_css_js() {         add_action( 'admin_enqueue_scripts', 'contacts_table_css_js', 11 );     }          function contacts_table_css_js() {         wp_enqueue_script( 'contacts', PLUGIN_URL . 'contacts/includes/contacts.js' );     }      The reason why I am creating a new CPT menu item is because it was once part of another plugin's submenu list - so I removed it from there and created its own menu item. I've done the same for another plugin's CPT - and that one worked fine. It's just this CPT from another plugin that is not working. Any clue on what may be going on? Thanks, Roc.


title: How to use pagination?

text:
I have the below code for a page, where I am pulling a photo, title and excerpt of the last 10 articles. The problem is, I don't know how to add pagination? I have installed WP-PageNavi aswell. I've seen some similar problems solved but I can't really get the concept at all and I am first trying to make sure that this is possible?               <?php /* Template Name: Opinion */ ?>     <?php get_header(); ?>

              <?php query_posts('cat=19&posts_per_page=10');        if(have_posts()) : while(have_posts()) : the_post(); ?>
           <a href="<?php echo the_permalink(); ?>">
<?php the_title(); ?>
           <?php the_post_thumbnail('medium'); ?>           <div <?php post_class(); ?> id="post-<?php the_ID(); ?>">           <?php the_excerpt(); ?>

       <?php endwhile; endif; wp_reset_query(); ?>

          <?php get_sidebar(); ?>     <?php get_footer(); ?>


title: Pagination resolving to first page only

text:
My pagination is only linking to the same posts that are on my front page. I have 3 posts on my front page, when I press next it goes to /page/2 but only shows the same 3 posts, with no previous button. The next button is still there, but still goes to page/1 Here is the full query.               <?php                      query_posts('post_type=post&posts_per_page=3');                      if ( have_posts() ) : while ( have_posts() ) : the_post();                      $category = choose_one_category(get_the_category());                      switch ($category){                     case "Festival News":                         $left[] = $post;                         break;                     case "Industry News":                         $centre[] = $post;                         break;                     case "Other":                         $right[] = $post;                         break;                 }                           endwhile;                  ?>

<?php previous_posts_link('« Previous') ?>

<?php next_posts_link('Next »') ?>

                 <?php endif;                                ?>


title: display different template based on post type

text: Hay, i have a custom post type "Events", however this is basically a post type, so it inherits the post.php template page. Is there anyway to use a different template (i.e events.php) if the content type is an 'event'?


title: Get term SLUG by term ID

text: I have a hierarchical taxonomy called 'tarefa' I have to display all posts from a child taxonomy. I used get_term_children function function to verify if the taxonomy parent has children. If the taxonomy parent has children I will query posts by taxonomy children. The problem is:   I have to query posts by taxonomy slug but the function get_term_children return an array of taxonomy IDS. The question is:   How can I return a taxonomy slug by a taxonomy ID?


title: Getting all user metadata from user

text: I am trying to show bio and other custom metadata for my users in a page. So, i want to query the user metadata table for it. I have tried but did not find any functions for that. What i am looking is getting all info doing a single database call. **This is what I have done so far:**                   $wp_user_search = new WP_User_Query( array( 'role' => 'agent', 'fields' => 'all_with_meta') );         $agents = $wp_user_search->get_results();          foreach($agents as $agent){       var_dump($agent);     }      **Result:**                   object(WP_User)#235 (7) { ["data"]=> object(stdClass)#233 (10)      { ["ID"]=> string(1) "2" ["user_login"]=> string(8) "test" ["user_pass"]=> string(34) "$P$BmGqM9h7Ct7fasdfsdf5bdBUnTIYeW.wI4AUIZ0" ["user_nicename"]=> string(8) "prionkor" ["user_email"]=> string(16) "sisir@tutrem.com" ["user_url"]=> string(26) "http://barnesandklatt.com/" ["user_registered"]=> string(19) "2011-12-19 13:17:27" ["user_activation_key"]=> string(0) "" ["user_status"]=> string(1) "0" ["display_name"]=> string(8) "prionkor" } ["ID"]=> int(2) ["caps"]=> array(1) { ["agent"]=> string(1) "1" } ["cap_key"]=> string(15) "wp_capabilities" ["roles"]=> array(1) { [0]=> string(5) "agent" } ["allcaps"]=> array(2) { ["read"]=> bool(true) ["agent"]=> string(1) "1" } ["filter"]=> NULL }       But it seems i am not getting all meta data Bio and other custom ones i have added (like twitter, facebook, phone etc.) Please let me know if you have any advice. Thanks!


title: Admin bar and fixed header issue?

text: I've styled my header to have a fixed top position. While logged in to wordpress, the wp admin nav bar covers the top section of my header making imposible to access my top navigation. I would like for the wp admin nav to push my top navigation below so both are visible. Does anyone know of any solution to fix this problem? An example of my problem can be found at... www.nickriversdesign.com/dev


title: Custom xmlrpc request does not pass parameters?

text: Here is what I have:               function xmlrpc_login($args){         var_dump($args); // is NULL         ...other logic that needs the args values...     }          function xmlrpc_add_methods($methods){         $methods['my.login'] = 'xmlrpc_login';         return $methods;     }     add_filter('xmlrpc_methods', 'xmlrpc_add_methods');      My test request looks like this:               $request = xmlrpc_encode_request('my.login', array('username', 'password');          $context = stream_context_create(array('http' => array(         'method' => "POST",         'header' => "Content-Type: text/xml",         'content' => $request     )));     $file = file_get_contents("http://site.com/xmlrpc.php", false, $context);     $response = xmlrpc_decode($file);          var_dump($response);      The simple question is why does $args not contain any values? How do I retrieve the values?


title: Displaying Child pages of the current page in post format and their thumbnails (featured image)?

text:
I'm using the following code I got from the Wordpress codex:               <?php // Displaying Child pages of the current page in post format                 $mypages = get_pages('child_of='.$post->ID.'&sort_column=post_date&sort_order=desc');                 $count = 0;                 foreach($mypages as $page)                 {                     $content = $page->post_content;                     if(!$content)                         continue;                     if($count >= 20)                         break;                     $count++;                     $content = apply_filters('the_content', $content);                 ?>

<a href="<?php echo get_page_link($page->ID) ?>"><?php echo $page->post_title ?>
                         <a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'twentyten' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_post_thumbnail(); ?>                         <?php echo $content ?>
                 <?php                 }             ?>      I tried the following code to get the featured image of the page:               <a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'twentyten' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_post_thumbnail(); ?>      and this one too:               $thumbnail = apply_filters('the_post_thumbnail', $thumbnail);      But it doesn't get the featured image. Any suggestions?


title: Sanitaizing Select Optin For Custom Post Type Metabox in WP

text: Using WordPress 3.8.1, I have a Custom post Type called "Map" and it contains a Metadata which is a Select options element as:               <label for="my_meta_box_select">Countries</label>     <select name="my_meta_box_select" id="my_meta_box_select">     <option value="asia" <?php selected( $selected, 'asia' ); ?>>Asia</option>     <option value="africa" <?php selected( $selected, 'africa' ); ?>>Africa</option>     <option value="america" <?php selected( $selected, 'america' ); ?>>America</option>     </select>          $selected = isset( $values['my_meta_box_select'] ) ? esc_attr( $values['my_meta_box_select'][0] ) : '';      so far I am using following code to save the selected option:               if( isset( $_POST['my_meta_box_select'] ) )         update_post_meta( $post_id, 'my_meta_box_select', esc_attr( $_POST['my_meta_box_select'] ) );      But from the point of Security check I am not sure that this is safe enough?! Do I have to check anything more like Sanitizing or Escaping on this kind of inputs, as well?( I already learned that we can Sanitize Text inputs but not sure about Select, or Checkbox inputs


title: how to stop a gallery slideshow

text: I am using the Dynamix WP theme. I have three images displaying in a loop with fade effect. The images continue to fade from one to other. However I would like to stop this effect once all images have shown. i.e on page load three images will fade from one to other and then stop. How can I achieve this? Is there something I can add to the shortcode to do this?


title: add_settings_field (exclude categories->reading) wp_category_checklist

text: In settings/reading, I'm trying to add an option to exclude one or more post categories from main posts/home page. I'd like to utilize the **wp_category_checklist** function to create the new settings " _field_ ". While I have successfully added a checklist under reading settings as intended, I don't see the means by which to get the selected values **output** to the new **exclude_cats** option on save. Meanwhile, I also tried adapting **wp_dropdown_categories** for multiple selection, and have successfully output selected values to the intended **exclude_cats** option, but don't see a way to return the dropdown with **current values pre-selected** in the field/dropdown after saving. Here's what I have...                   class Add_Settings_Field {         /* Class for adding a new field to the options-reading.php page */         public function __construct() {             add_filter( 'admin_init' , array( &$this , 'register_fields' ) );         }         public function register_fields() {             register_setting( 'reading', 'exclude_cats');             add_settings_field('exclude_cats',                 'Exclude Categories',                 array( &$this, 'fields_html' ),                 'reading'             );         }         public function fields_html() {             // This would suffice if I could set the current values as selected in the resulting dropdown.             $select_cats = wp_dropdown_categories('&hierarchical=1&hide_empty=0&orderby=name&name=exclude_cats&show_count=0&title_li=&use_desc_for_title=1&echo=0');             $select_cats = str_replace( "name='exclude_cats' id=", "name='exclude_cats[]' multiple='multiple' id=", $select_cats );             echo $select_cats;             // I would prefer this if only I could get the selected values output to the "exclude_cats" option in wp_options on save.             // $selected_cats = get_option( 'exclude_cats');             // $exclude_cats = wp_category_checklist( '', '', $selected_cats, '', '', 1);             // echo $exclude_cats;         }     }     new Add_Settings_Field();          add_filter('pre_get_posts', 'exclude_cats');     function exclude_cats($query) {         if ( $query->is_home() ) {             foreach(get_option( 'exclude_cats') as $excluded) $excluded_cats[] = $excluded*-1;             $excluded = implode(",",$excluded_cats);             $query->set('cat', $excluded);         }   return $query;     }


title: Custom post type archive with pagination?

text: I have a custom post type called 'projects' (pastebin) and I have a page called Projects set up in my dashboard which is set to display the Projects template. (pastebin) The problem is when I use WP_PageNavi to incorporate pagination and click on page 2, I get an error 404. I read somewhere that this is because custom post types and pages can't have the same name. And I've found that to be true because I tried changing the page name to "Projects 2" and it worked. But when I change the name of the custom post type, that gets reflected in the url. So if I change the custom post type to 'projects2' instead of just 'projects', the url now looks like this: mysite.com/projects2/single-post I have my custom permalinks set to /%category%/%postname%/ by the way. Likewise, I can't change the name of the page to 'Projects 2' for aesthetic reasons. So how would I get around this? This has been driving me crazy for many hours. I would really appreciate any helpful advice!


title: How to List all Sidebars in a Metabox

text: I'm trying to add a metabox to every page that is a drop down list of all registered sidebars that is then saved in a custom field. I'm using this metabox class I've gotten as far as this:               // get registered Sidebars     $sidebars = $GLOBALS['wp_registered_sidebars'];     foreach ( $sidebars as $sidebar ) {         $sidebar_options[$sidebar['name']] = $sidebar['name'];     }      Then I call the $sidebars variable in my metabox declaration like so:               $meta_boxes[] = array(         'id'         => 'page_metabox',         'title'      => 'Page Custom Fields',         'pages'      => array( 'page', ), // Post type         'context'    => 'normal',         'priority'   => 'high',         'show_names' => true, // Show field names on the left         'fields'     => array(             array(                 'name' => 'Page Sidebar',                 'desc' => 'Choose the Sidebar to show on this page.',                 'id'   => /*$prefix .*/ 'erh_page_sidebar',                 'type' => 'select',                 'options' => $sidebar_options,                    )              )           );      This is the result of $sidebar_options:               $sidebar_options = array (      'Header Sidebar' => 'Header Sidebar',      'Main Sidebar' => 'Main Sidebar',      'News Sidebar' => 'News Sidebar',      'Home Panel 1' => 'Home Panel 1',      'Home Panel 2' => 'Home Panel 2',      'Home Panel 3' => 'Home Panel 3',      'Footer 1 Sidebar' => 'Footer 1 Sidebar',      'Footer 2 Sidebar' => 'Footer 2 Sidebar',      'Footer 3 Sidebar' => 'Footer 3 Sidebar',      'Footer 4 Sidebar' => 'Footer 4 Sidebar',      'Footer 5 Sidebar' => 'Footer 5 Sidebar',      'Footer 6 Sidebar' => 'Footer 6 Sidebar',      'Right Sidebar 1' => 'Right Sidebar 1',      'Staff login Sidebar' => 'Staff login Sidebar',      'Staff Sidebar' => 'Staff Sidebar',      'Careers Sidebar' => 'Careers Sidebar',      'Care Providers Sidebar' => 'Care Providers Sidebar',       )      my problem is that this metabox class wants the drop down options to be in this form and I don't know how to do that:               array( 'name' => 'Sidebar 1', 'value' => 'Right Sidebar 1', ),     array( 'name' => 'Sidebar 2', 'value' => 'Right Sidebar 2', ),     array( 'name' => 'Sidebar 3', 'value' => 'Right Sidebar 3', ),      Any help is much appreciated :-)


title: Remember the meta value with radio buttons

text: I've created a simple meta box consisting of two radio buttons: yes or no. When they click on the appropriate box, it saves the meta value to the database. However, the post page does not remember it has done this: whichever radio button was pressed, the 'checked' value is no longer there. Below is the code. What is the best way to save the 'checked' state — so the user will know which was checked?               ## ADD TOP META BOX          function top_custom_meta(){         add_meta_box('top_meta', 'Is this a top post?', 'top_meta_callback', 'post', 'side', 'high');     }          add_action('add_meta_boxes', 'top_custom_meta');          ## OUTPUTS TOP CONTENT           function top_meta_callback( $post ) {         wp_nonce_field( basename( __FILE__ ), 'top_nonce' );         $top_stored_meta = get_post_meta( $post->ID ); ?>                 <div>             <label>                 <input type="radio" name="top-radio" value="radio-one-a">                 <?php echo 'Yes' ?>             </label>                 </div>                      <div>             <label>                 <input checked="checked" type="radio" name="top-radio" value="radio-two-b">                  <?php echo 'No' ?>             </label>           </div>              <?php     }          # SAVE TOP OUTPUT TO DATABASE          function top_meta_save( $post_id ) {              // Checks save status         $is_autosave = wp_is_post_autosave( $post_id );         $is_revision = wp_is_post_revision( $post_id );         $is_valid_nonce = ( isset( $_POST[ 'top_nonce' ] ) && wp_verify_nonce( $_POST[ 'top_nonce' ], basename( __FILE__ ) ) ) ? 'true' : 'false';              // Exits script depending on save status         if ( $is_autosave || $is_revision || !$is_valid_nonce ) {             return;         }              // Checks for input and sanitizes/saves if needed         if( isset( $_POST[ 'top-radio' ] ) ) {             update_post_meta( $post_id, 'top-radio', sanitize_text_field( $_POST[ 'top-radio' ] ) );         }          }     add_action( 'save_post', 'top_meta_save' );      I basically need to add `checked="checked"` to whichever radio button was pressed.


title: custom header text

text: I am creating a custom website by modifying the twenty-eleven theme. I want to create custom text in the header area that is unique to each page. Is there a way to add a 'description' to each page and then use php to call on that description? Currently it displays the "site title" here is the url to the site so you can see what im talking about. www.tenspeedgreens.com where it says 'ten-speed greens' is where i would like the custom text to be displayed. thanks


title: Configuring a meta query with multiple post types that have the same relationship on a single page

text: I am creating a client portal were my clients can maintain their projects and leave feedback. I have two custom post types called "Clients" and "Projects" and they each pull information from one another in the backend. When I create a client it automatically generates its postID to a drop down menu on the projects post type were I can assign a client to a project. What I am trying to accomplish is by displaying all projects that are associated with the selected client on a single page on the front end. The single page will be the client portal, which is generated by the client post type. I seem to be having trouble with the value and the compare. When I change the value to the clients actually ID number I get all the assign projects for client A, but when viewing client B I am viewing client A projects ( I know this because I am assigning the value to a specific client ID). Now when I change the value to `get_the_ID()` it does not display any of the post unless I change the compare to NOT IN. Is there a way I can display all selected project post to its assign client without displaying all post I have created in the custom project post? Here is my code for single.php which will be displaying the projects on the clients portal.                <?php       global $post;      $projects = new WP_Query( array(      'post_type'         => array( 'projects'),      'posts_per_page'    => -1,     'post_status'     => 'publish',         'meta_query'        => array(              array(                  'key'           => 'clientType',                  'value'         => array( $postid = get_post_meta( $post->ID, 'clientType', true )),                    'compare'       => 'LIKE',                  'type'          => 'NUMERIC'      ))));       ?>      Below is the code I am using to assign a client to a projects in the admin panel of projects. This script displays any client that I created in the client page and display their names in a drop down menu.                class projects {        var $FOR_POST_TYPE = 'projects';        var $SELECT_POST_TYPE = 'client_portal';        var $SELECT_POST_LABEL = 'Client';        var $box_id;        var $box_label;        var $field_id;        var $field_label;        var $field_name;        var $meta_key;         function __construct() {           add_action( 'admin_init', array( $this, 'admin_init' ) );         }      function admin_init() {          add_action( 'add_meta_boxes', array( $this, 'add_meta_boxes' ) );          add_action( 'save_post', array( $this, 'save_post' ), 10, 2 );         $this->meta_key     = "_selected_{$this->SELECT_POST_TYPE}";         $this->box_id       = "select-{$this->SELECT_POST_TYPE}-metabox";         $this->field_id     = "selected-{$this->SELECT_POST_TYPE}";         $this->field_name   = "selected_{$this->SELECT_POST_TYPE}";         $this->box_label    = __( "Select {$this->SELECT_POST_LABEL}", 'projects'         );         $this->field_label  = __( "Choose {$this->SELECT_POST_LABEL}", 'projects'    );        }      function add_meta_boxes() {       add_meta_box(            $this->box_id,            $this->box_label,            array( $this, 'select_box' ),            $this->FOR_POST_TYPE,            'side'         );      }        function select_box( $post ) {          $selected_post_id = get_post_meta( $post->ID, 'clientType', true );          global $wp_post_types;          $save_hierarchical = $wp_post_types[$this->SELECT_POST_TYPE]->hierarchical;          $wp_post_types[$this->SELECT_POST_TYPE]->hierarchical = true;          wp_dropdown_pages( array(           'id' => $this->field_id,           'name' => $this->field_name,          'selected' => empty( $selected_post_id ) ? 0 : $selected_post_id,          'post_type' => $this->SELECT_POST_TYPE,          'show_option_none' => $this->field_label,               ));          $wp_post_types[$this->SELECT_POST_TYPE]->hierarchical = $save_hierarchical;               }          function save_post( $post_id, $post ) {             if ( $post->post_type == $this->FOR_POST_TYPE && isset( $_POST[$this->field_name] ) ) {           update_post_meta( $post_id, 'clientType', $_POST[$this->field_name] );            }          }        }      new projects();


title: How to Pull Out Twitter Summary Data in other areas of my template?

text: I am curious on how www.gigaom.com is able to callout the summary data of their articles. In addition I am trying to figure out how the summary autoposts when you select the tweet this button and the author's twitter gets tweeted as well. I suspect the latter is available via twitter cards, but how can I get the summary data to show before the post content. A custom field? Micro-data? Here are two examples of what I am talking about... http://gigaom.com/2013/09/07/from-the-founder-of-aptera-tiny-and-stackable- ultra-efficient-organic-farms/ http://gigaom.com/2013/09/07/an-mlb- photographer-shows-you-how-to-instagram-in-the-big-leagues/ Any feedback is appreciated.


title: replace wp_get_attachment_image with my own function

text: How can I replace wp_get_attachment_image() function without changing the core files. The function doesnt have an action hook or a filter hook. **What I am trying to achieve:** for lazyload plugin output the image html like this:                     instead of this:


title: Responsive theme 'undefined' on woocommerce single product pages in mobile nav bar

text: I am using the responsive theme for my mobile site and am using 'any mobile theme' plugin to implement that them whenever someone is on a mobile device. when I am on a woocommerce single product page the mobile nav bar displays the name of the page as 'undefined.' I do not want that. I would prefer to have the name of the product. Until an upgrade to the theme comes out (which they said is would be fixed then), I need a solution. As others have suggested I have tired to: In my child theme functions.php file, I have added:               <?php add_action( 'wp_head', 'mobile_menu_fix' );     function mobile_menu_fix() { ?> <script type="text/javascript">$( document      ).ready(function() {$("#responsive_current_menu_item").html("Navigation");         });</script><?php } ?>      This makes the mobile menu display “Navigation” as the heading on every page. And I have also tried putting this code in my header.php:               if ($(“#responsive_current_menu_item”).html().toLowerCase() == “undefined”) {     $(“#responsive_current_menu_item”).html(“Menu”);     }      I am not sure if I am adding these codes in properly or if the codes are just not right. I really would appreciate some help on this. Thanks.


title: How to purge all transient caches?

text: Is there an easy way to delete all transient caches? A plugin maybe? Or like in drupal "drush cc all"?


title: Print shortcode in custom action hook not where the shortcode is entered

text: I have added a custom action hook into my theme. I want to be able to enter a shortcode anywhere in the_content() and have the shortcode print were the custom action hook is rather then the point from where the shortcode was entered. The shortcode displays a gallery and the custom hook in the header. It works if I do_shortcode() directly in the action callback but the shortcode displays on all pages. So I know the hook it working but I only want the gallery to display in the header of pages that the shortcode is entered into the_content().


title: Highlight wp_nav_menu when category is selected

text:
Using the wp_nav_menu() function to display my menu I noticed the highlighting in the menu was working well for the pages I created (like archives.php) but not anymore when a date (date.php), category (category.php) or tag (tag.php) was selected. How can I keep my "Browse" menu entry highlighted when a category is selected? Here is how I include the menu in header.php:
         <?php wp_nav_menu(array('menu' => 'primary', 'menu_class' => '', 'container' => false, 'theme_location' => 'header')); ?>
      The Firebug excerpt when the archives page (called "Browse" in the menu) is selected, here it is the id "menu-item-299":

      And finally, when I selected a date, or a category:

      The live version is accessible here: http://www.slyvain.fr/v2/?page_id=280 This being my first template, I am pretty sure I forgot or missed something but can't figure it out, thank you very much for your help!


title: how do I change the side bar content?

text: As of now, my side bar is pretty standard: How can I change it so that it shows tags, recent posts, etc... ![enter image description here](http://i.stack.imgur.com/Fr6j1.jpg)


title: How to call either page name as the nav link or navigation title?

text: I bascially need to just be able to show the polish translated menu or the english menu. The best way I can think of it is:               if($languageCookie=='polish'){       wp_nav_menu(use the navigation label rather than the page title)     }else{       wp_nav_menu(use the page title rather than the navigation label)     }      That is because in appearance>menus for each menu item you can also choose to have a navigation label and a title label.


title: Only on single post page

text: I am using this code to show ad below single post but only if it is in specified category. Code is giving right out put but it is also showing up on archive pages. I just want to show on single post pages.               function demo_link() {             if (in_category('themes')) { ?>          Some code         <?php } else { ?>         Some code         <?php             }         }         add_action('thesis_hook_after_post_box', 'demo_link');


title: loop through custom post-type with two meta_keys

text: I have a custom-post-type named `my_project`. This post-type has two meta- boxes:   * `is_featured`   * `is_featured_position` So essentially in my backend of the post-type I can set a **checkbox** for `is_featured` and enter a **number** for `is_featured_position` ![enter image description here](http://i.stack.imgur.com/gC6p1.png) This allows me to set a "project" to my homepage of my website. I have a function called `get_project_list()` that should return all my "featured" projects.               function get_project_list( $order = 'DSC' ) {         $args = array(             'post_type' => 'my_project',             'posts_per_page' => -1,             'orderby' => 'meta_value_num',             'order' => $order,             'meta_key' => 'is_featured',             // 'is_featured_position' ???         );              $loop = new WP_Query( $args );         while ( $loop->have_posts() ) : $loop->the_post();             global $post;             get_template_part( 'inc/project', 'item' );         endwhile;     }      This already **works fine** right now. The only question I have is how I can implement my "position" or "order" of my featured posts! All I want to do is additionally sort by the second meta_key `is_featured_position` which is a normal number. So if I call `get_project_list( 'DSC' )` I want all featured posts returend in the order that is set inside `is_featured_position`. Just like you know it from the normal wordpress `Pages` where you can set the Order of the list- pages function. How can I filter by this second meta_key? Thank you in advance.


title: How do I make my navigation bar link to an external page?

text: My website is wordswithfriends.net At the moment all of the top navigation menus link to an internal page. I want "Contact Us" to link to an external page ask.wordswithfriends.net How do I do this in the administration panel? At the moment all I see are options for editing the page


title: how to load custom single.php?

text: Hi I have a blog where the categories are news, events and inspiration. These categories are selected using radio buttons on acf. I want to load news on single-news.php while events on single-events.php and inspiration on single- inspiration.php is it possible to use the acf fields to do this? I have came across this code with wordpress default categories to load custom single.php               $post = $wp_query->post;     if (in_category('1')) {         include(TEMPLATEPATH.'/single1.php');     } elseif (in_category('2')) {         include(TEMPLATEPATH.'/single2.php');     } else {         include(TEMPLATEPATH.'/single_default.php');     }      what can be used instead of the ‘in_category’ while using acf? thanks guys.


title: adding custom fields to next and previous post link

text:
Im trying to make my next and previous post buttons display my custom field but for some reason it doesnt display the custom field its just blank. Heres my code.
           <?php                $previous_post = previous_post_link('%link', ''.$image_prev.'', TRUE);           $next_post = next_post_link('%link',''.$image_next.'', TRUE);           $image_prev = get_post_meta( $previous_post->ID, 'image', true);           $image_next = get_post_meta( $next_post->ID, 'image', true);           ?>                <?php if ( $image_prev != '' ) : ?>             <img src="<?php echo $image_prev; ?>" alt="" />           <?php endif; ?>                <?php if ( $image_next != '' ) : ?>             <img src="<?php echo $image_next; ?>" alt="" />           <?php endif; ?>                <?php previous_post_link('%link', 'Previous post', TRUE); ?>           <?php next_post_link('%link', 'Next post', TRUE); ?>


title: Programmatically Add Item to WP Multisite Menus

text:
Does WP Multisite require a specific function in order to programmatically add a menu item to a menu? A friend and I have a plugin that adds a menu item to your menu found here. When we created it we assumed it would work with WordPress Multisite, but the few users who have tried it have had difficulty. One guy got a fatal error which doesn't seem to be related: Fatal error: Call to undefined function wp_get_current_user() in /home/cmnet/public_html/wp- includes/capabilities.php on line 1451. Another got it to show up, but said that it "crashed" I.E. and not all of the menu displayed. Here's how we're currently doing this, but is there something we need to change to make this work with WordPress multisite. Filter:               if ( isset( $this->options['menu_name_1'] ) && $this->options['menu_name_1'] != '0' ) {                         add_filter( 'wp_nav_menu_' . $this->options['menu_name_1'] . '_items', array( &$this, 'add_itemcart_to_menu' ) , 10, 2 );                 }      Function:               public function add_itemcart_to_menu( $items ) {                 $classes = 'wpmenucart-display-'.$this->options['items_alignment'];                      if ($this->get_common_li_classes($items) != '')                         $classes .= ' ' . $this->get_common_li_classes($items);                      $classes .= (isset($this->options['custom_class']) && $this->options['custom_class'] != '') ? sprintf( ' %s', $this->options['custom_class'] ) : '';                      // Filtering done here (instead of in function) to prevent issues with ajax                 $wpmenucart_menu_item = apply_filters( 'wpmenucart_menu_item_filter', $this->wpmenucart_menu_item() );                      $item_data = $this->shop->menu_item();                      if ($item_data['cart_contents_count'] > 0 || isset($this->options['always_display'])) {                         $items .= '
' . $wpmenucart_menu_item . '
';                 }                      return $items;         }


title: add slug of child(ren) to li using wp_list_pages

text:
For a page template I am trying to include the 3 children of each page. That works fine. However as I want to include a different image for each of the children, I would like to add the `slug` of each child to the `li` on the parent page. I found something that places the `slug` of the parent page in the `li`'s:               <?php      $slug = basename(get_permalink());     wp_list_pages('title_li=&sort_column=menu_order&link_before=
&link_after=
&child_of='.$post->ID.'');     ?>      Obviously not what I want, but at least nice to see that it is possible somehow to add something to the li in order to be able to identify it further with CSS. I would like the result to be something like:

...

...

      OR (as the example above shows)

...

...

      Can anyone push me in the right direction?


title: Insert JavaScript in a blog post or a new page?

text: I want to insert some JavaScript into my post. Actually those are some small apps made in JavaScript. Please let me know how to insert the JavaScript into the post ?


title: Problems with redirecting a BuddyPress custom subnav item

text: Using WP 3.9.1 and BuddyPress 2.0.1. I want to add a subnav item to the "groups" tab that takes you to the "create a new group" page. I have the following functions:               add_action( 'bp_setup_nav', 'ecomukti_add_create_village_subnav_tab', 100 );          function ecomukti_add_create_village_subnav_tab() {     global $bp;          bp_core_new_subnav_item( array(     'name' => 'Create Virtual Village',     'slug' => 'create',     'parent_url' => trailingslashit( 'step/group-details' ),     'parent_slug' => 'groups',     'screen_function' => 'ecomukti_create_village_screen',     'position' => 50     )     );     }          function ecomukti_create_village_screen() {     bp_core_redirect( get_option('siteurl') . "groups/create/step/group-details/" );     }      For the most part, this works fine - it correctly adds the subnav item. However, the problem is with my screen_function. It seems to totally ignore the screen_function. The URL created by bb_core_new_subnav_item() is http://mysite.com/members/membername/groups/step/group-details/create/ \- obviously that page doesn't exist, and I really want to go to http://mysite.com/groups/step/group-details/create/ That's why my screen_function is a redirect. But no matter what I put in bp_core_redirect, the redirect doesn't happen - it still goes to http://mysite.com/members/membername/groups/step/group-details/create/ So what am I doing wrong? How can I get this function to properly redirect to the "create group" page?


title: menu in different page in different style

text: I have a one column page for the home page where I have a mega menu and in side the site there is another page called about us where the mega menu is present but it is in small format just like it differs from the mega menu in width and height.So for home page I have used widget and now for about us page I want the small mega menu.So can any one tell me how to do that.I heared about if(front_page()), so I am using this but nothing is happening.So please guide me.Thanks in advance.


title: Count how many posts in category, based on result display link or not

text: This is what I'm trying to do: if number of posts is greater than 20 -> display link to another page (which shows all posts) if number of posts is less than 20 -> don't display the link So far I've been able to return the number of posts using               $count_posts = wp_count_posts('inventory');     $published_posts = $count_posts->publish;      but I don't know where to go from here, any suggestions?


title: Custom post type's extra fields - how to handle?

text: I've refrained from asking this question for a couple weeks, as I wasn't completely certain what I wanted cleared up... think I got it. I'm in the process of putting together a plugin to run a somewhat complex portfolio feature for my new personal site. The need was for a reasonable number of custom fields for each portfolio item, a number of categories (illustration, web design etc) and a way to build relationships. I use those categories to populate a list which delivers data via user submitted ajax requests. I weighed several options for this and landed on _what I knew_ \- and specifically didn't use custom post types; really, the only reason was ignorance. I did read a number of articles on the subject, but it just wasn't clear to me how to accomplish my goals. At any rate - I've spent the last couple weekends building a plugin that creates three new tables, deals with CRUD from the admin pages, and controls ajax requests. And it works great, in fact, for the "multi" template (which just gathers categories of thumbnails). Then I started working on the "single" page (which would just be a template for the display of a single line item), and it dawned on me that to incorporate searching, comments, permalinks etc, I was going to have to do a lot of hacking to tie my custom data into the main wp system. At any rate. I've since come understand that I can, in fact, use custom post types to hold the portfolio line items, and a custom taxonomy to develop the set of terms I will need for categorization. I'm hoping someone can fill me in on some of the details that are still sticking (because the documentation on this subject is very thin, at best...). The code to create a custom post type seems pretty straightforward, as is the code for a custom taxonomy, but I am still unclear on a couple points: 1. **Custom Fields** How do I manage them? I have about 20 columns that I'm populating - I've read a few things stating they are created via meta boxes? What table is that data actually stored in? wp-posts? 2: **Custom Terms** I understand how to create a custom taxonomy, but how do I go about linking my custom post type with that taxonomy? How do I filter a query for this taxonomy to populate the front-facing ajax drop-down selector? Are there plugins that can make this easier? I'm planning on coding everything at this point. Finally, given the scope of my project, **are custom post types appropriate for what I'm trying to do**? Does it make sense to scrap what I've already put together? Honestly - this is my first attempt at a plugin, and I've learned quite a lot - but the addition of wp features like searching, comments, permalinks etc. all seem pretty attractive. I submit to the experts - ### Update > How do I filter a query for this taxonomy to populate the front-facing ajax > drop-down selector? Let me explain this more clearly. When the front-facing portfolio page is visited by a user, I run a query on all the available terms (currently this term data is from my non-wp, custom tables), and use those to populate either a drop-down selector, or just an unordered list. I hook into those elements to pass (in this case) ID values (categories like 'illustration' or 'web design') to an ajax sequence, which returns a json object containing sql results. I then build out thumbnails and other content for these items dynamically. The question then, is _how do I structure a query to return custom post types based on terms from a custom taxonomy_? As long as I can return a json object from that query, I can just use my current ajax / js sequence as it stands. Thanks for the help -


title: A plugin to show post tags in a widget

text: I'm looking to show the tags of a post within a widget. I know this is hard because it's outside of the loop, but has it been done, is there one available? Thanks for any assistance. Hudson


title: Adding div after every two post on main loop! Why will first post not get counted?

text:
So I am trying to add a div after every two posts in home.php and I almost followed the answer found here but changed it a bit to function with the rest of the theme. Now the problem is that in the first div that is hardcoded there are three posts, not two. I believe the problem is in how the posts are counted, but not 100% sure. Would love to get some pointer if there is anything wrong in the way I count posts or if the problem is somewhere else. Here is my home.php               <?php get_template_part('templates/page', 'header-home'); ?>          <?php if (!have_posts()) : ?>
     <?php _e('Sorry, no results were found.', 'roots'); ?>
     <?php get_search_form(); ?>     <?php endif; ?>
     <?php while (have_posts()) : the_post(); ?>     <?php get_template_part('templates/content', get_post_format()); ?>     <?php if ( 0 !== $wp_query->current_post          && 0 == $wp_query->current_post%2      ) {         echo '

';      } ?>     <?php endwhile; ?>
          <?php if ($wp_query->max_num_pages > 1) : ?>

<?php next_posts_link(__('← Older posts', 'roots')); ?>

<?php previous_posts_link(__('Newer posts →', 'roots')); ?>

          <?php endif; ?>


title: Blank search results on custom search

text: I have a custom search with the following line of html in the form:               <input type="hidden" name="post_type" value="product" />      This correctly appends: &post_type=product to the search query in the URL Unfortunately it returns a blank page. When I remove the hidden field I get results but obviously none are included from my custom post type. I have tried disabling plugins to no avail. I have tried swapping out my search.php page with the same file from TwentyFourteen. I have removed the search.php page completely. I have tried installing plugins that provide the functionality of searching through custom posts to no avail. This is a woo commerce site and when I use the woo commerce plugin (working fine on other sites) I get the blank page. Regardless of what I have done I always get the blank page when I add any kind of custom code to my search. WordPress and plugins are all up to date. I have spent ages searching for a solution online to no avail. I am stuck now so am reaching out for assistance with this one. Any help or guidance would be greatly appreciated. UPDATE: After some additional testing I have discovered that this only happens when the post_type being passed to the query string is 'product'. I am using Woo Commerce and am trying to add a search for products to the standard WordPress search. I still am scratching my head on this one.


title: I want to display tag description and tagged attachment (without post if there isn't..) while using tag url

text: I am new to coding, but i do understand a little bit. Is there a way to edit tag.php to achieve this? I have added Shiba media library plugin to my site so that i can add tags and catagories to attachments, but tag.php is written in a way that it only shows tagged posts. Please help :)


title: Overide enqueue in non plugable function via child theme

text: I am trying to override a non-plugable function using the information on this page but it seems to have no effect. Can anyone see what's wrong. My code is               remove_action('wp_print_styles', 'az_enqueue_dynamic_css');          function childtheme_dynamic_css() {         /* I don't need to actually add anything so this is just a placeholder */     }          add_action( 'wp_print_styles', 'childtheme_dynamic_css' );


I looked at WP's site and didn't see a role I could use. I can create my own, but how do I limit the content on the page itself? Some private and some public information can be on the same page. I could create two pages, but I didn't know if WP had a way to do this or where I might build my security to allow this. How can I restrict access to specific parts of a page, not just the page itself?


title: How can I modify a post depending on the source of the traffic?

text: I have a wordpress site. If I include some javascript on a post, I show ads on the post. I want to only show that javascript when people come to my site from google search (as opposed to from twitter or facebook -- or by going to the URL directly). Is there any way to do that from within wordpress?


title: Options to develop a non-ecommerce catalog?

text: I'm looking to incorporate a product catalog into a client's website. I need the product display functionality in terms of being able to display a grid of categories with thumbnails, then browse each one and have the option to add subcategories, and finally a product listing with individual product display. What I don't need is to sell products online, so anything related to ecommerce is superfluous: prices, stock, cart, checkout. I'm using Woocommerce because it's very flexible and it handles my catalog needs fine. But there are way too many stock/pricing/selling/shipping options and I'd like to keep the admin as simple as possible for my client to handle their products. What other options exist out there that may be better suited for this type of application? I tried Googling but seems every single "catalog" plugin is geared to ecommerce. I would've done it with custom post types but I need that ability to browse categories and subcategories and have thumbnails assigned to them. Edit: I'm comfortable with custom fields and custom post types and I'd actually prefer using that; what I'm not sure how to achieve is the category/subcategory pages. I'd need to be able to assign images to categories, plus create a three level page system:   * Catalog index would be a list of categories, with thumbnails.   * Clicking on a category would take you to another page with a list of its subcategories. Ideally, this page could also show a complete list of items under that category, to be filtered when a user clicks on a subcategory.   * Finally, when clicking on a subcategory, the products under that subcategory would be displayed in a thumbnail grid. I hope I'm explaining myself well. Thank you.


title: Combining tags from post types

text: I am trying to create a tag cloud that combines different post types. When I do a generic wp_tag_cloud, it only pulls the tag from posts, but if I add the custom post type that I want to include in the args, then it displays tags from those posts. However, if I have the same tag in a post and in a custom post type, it shows up twice, instead of being combined. For example, if I have a tag of "trampolines" in a post and the same tag in a custom post type of portfolio, then the tag cloud will display trampolines twice instead of weighting it as double. Any ideas how I can accomplish this?               <?php $args = array(     'smallest'                  => 8,      'largest'                   => 18,     'unit'                      => 'pt',      'number'                    => 450,       'format'                    => 'flat',     'separator'                 => \\"\n\\  ",     'orderby'                   => 'name',      'order'                     => 'ASC',     'exclude'                   => null,      'include'                   => null,      'topic_count_text_callback' => default_topic_count_text,     'link'                      => 'view',      'taxonomy'                  => array('post_tag', 'portfolio_tag'),      'echo'                      => true          ); ?>          Tags:  <?php wp_tag_cloud( $args ); ?>


title: Hide a template part when page is password protected?

text: I'd like to hide the sidebar of my page when the page is password protected and the password has not yet been entered. I've searched for a while and haven't found any condition I could use. Maybe `get_post_status` could help, but still, I wouldn't know when the user has entered the password and can see the full page.


title: Best practice - Meta Query vs. post_clauses for "left join" ordering

text: Moreso a psuedo-code question than actual code. I have some custom post meta attached to attachments, and created a list table column for this meta. The meta is either 1, or null (not set), but I am trying to enable sorting for said column. Is there a way to utilize `meta_query` for WP_Query to essentially LEFT JOIN, where I get all values (1 or null), and then I can utilize `orderby=meta_value_num` for ordering? The obvious way it would work is hooking into posts_clauses, adding a JOIN, and doing the orderby as well - just curious if this would be possible while using direct WP_Query functionality! Thanks.


title: comment_post_ID 0 (cannot remove from dashboard)

text: Ran across something a bit odd that I haven't seen before. A client has a pretty active blog and uses Akismet (paid) to protect against spam. At least once a day, they're reporting a spam comment that is correctly marked as spam, but cannot be removed from the admin dashboard by clicking `Empty Spam` or manually selecting the entry and trying to delete it. I looked into this and noticed that the DB entry has a `comment_post_ID` of `0`, which I'd have to assume means it is not attached to any post. I can obviously remove them manual from the DB (and it works just fine), but haven't found any information on what this could be. I've replaced the core WP files (thinking it might be a security issue) and also re-generated the salts/keys in the `wp-config.php` file without any change. Any thoughts would be a huge help. thanks! # Update While this may have stemmed from, I'm not sure if it is the result of the InMotion hack. Here's what's been done:   * Changed FTP, MySQL passwords   * Created new DB user, assigned to database   * Updated salts/keys in `wp-config.php`   * Changed all WP user passwords   * Re-installed core WordPress files Akismet is out of ideas on this one (don't blame them) as this one is persistent.


title: is it possible to add new user Roles?

text: I wonder if it is possible to create a new user role and give him special limited abilities? I'd like to have some users who can only add events onto the calendar. They should only be able to work within events calendar taxonomy and edit add their posts but not publish them something like contributor but more limited!


title: Replace category name with article id in wordpress urls

text: I would like to know, using wordpress, how to replace the category name with the article id in the url ? For example, I have a url of this kind :               http://mywebsite.com/css/the-name-of-my-css-article      And I would like to change it into :               http://mywebsite.com/article-id/the-name-of-my-css-article      Is there anybody who know to do it ?


title: Hide a div from a particular page and single pages in Wordpress

text:
I am creating a wordpress theme from scratch. I have created a seperate page to show the Blog Posts. In my all pages I want to show a div class named as shopping-cart, but I want to hide it from page **id=42 (wordpress-naked BlogPage)** and **single.php**. I have coded in my header.php like below               <?php if( is_page() ) { ?>
Shopping Cart :  items -         View Cart

▲

Your Cart Details

Items:

Total:

Grand Total:

<img src="<?php bloginfo('stylesheet_directory'); ?>/images/paypal.png"/>

<img src="<?php bloginfo('stylesheet_directory'); ?>/images/google-chk.png"/>

<img src="<?php bloginfo('stylesheet_directory'); ?>/images/clear.png"/>

Close

               <?php } ?>      It is working fine. The particular div shopping-cart is showing in the pages and hiding from the single.php. But the problem is that I have coded Blog as a separate blog.php which is a page named as wordpress-naked BlogPage and having it's page id =42. So now I want to hide the shopping-cart div in the wordpress-naked BlogPage and single.php together. I got stuck in this. Can anyone please to sort it out. Thanks in advance.


title: Wordpress the_content() return only one image from a specific category

text:
I am working on a Wordpress website and I am using a loop to get all the posts that have title and body contain an image. But the problem is that it returns me all the titles but not all the images. I don't understand why. Here is the code:               <?php  query_posts('cat=17&order=ASC');     remove_filter('the_content', 'wpautop');          if (have_posts()) : while (have_posts()) : the_post();         ?>
             <?php $args = array('post_type' => 'attachment', 'numberposts' => 34, 'post_status' => null, 'post_parent' => $post->ID);             $attachments = get_posts($args);             if ($attachments) {                 foreach ($attachments as $attachment) {                     ?>                     <a href="<?php echo $attachment->guid;?>" class="lb_gallery"><?php the_content();?>                 <?php                 }             }?>
                 <?php the_title();?>

          <?php endwhile; ?>     <?php endif; ?>      And here is the output on front-end: ![enter image description here](http://i.stack.imgur.com/TS8YR.jpg) In the above image you can see titles like _foto-1_ , _foto-2_ , _foto-3_ and so on. All these titles are coming through loop but it displays the image for the first one only but all posts are having the image as in the `foto-1`.


title: Custom password generator for users

text: I'm using WP-Members to let new users register on my site. After they register I check their information and activate them, which emails them a password. The password that WordPress generates is pretty complicated, e.g. `v2Fj4S#b1Df(`, but my users are older and I'd like to give them passwords which are a little more memorable, like `bucket382potato`. Can I override the native password generator in WordPress to supply my own password scheme?


title: Change the Slug of Post Type post to baseurl/post/%postname%

text: I have been searching around but i cant anywhere find the answer to my question: How to change the post slug for all posts (and the categories etc.). Without affecting other pages/ custom post urls. So i want to change the url for default posts from: url/postname > url/news/postname Without affecting page urls and or custom post type urls. The only method i have so far found that achieved what i was looking for was: http://wordimpress.com/how-to-add-a-custom-permalink-structure-for-only-the- wordpress-default-post-type/               add_action( 'init', 'my_new_default_post_type', 1 );     function my_new_default_post_type() {          register_post_type( 'post', array(         'labels' => array(             'name_admin_bar' => _x( 'Post', 'add new on admin bar' ),         ),         'public'  => true,         '_builtin' => false,          '_edit_link' => 'post.php?post=%d',          'capability_type' => 'post',         'map_meta_cap' => true,         'hierarchical' => false,         'rewrite' => array( 'slug' => 'post' ),         'query_var' => false,         'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'trackbacks', 'custom-fields', 'comments', 'revisions', 'post-formats' ),     ) );     }      By re-registering the post type. But this also has the side effect that it creates a second menu item on the left side of the admin panel called post. They both contain the same data though. Hopefully somebody has an answer to this problem.


title: Have posts that belong to multiple categories, exclude some categories from homepage

text:
So I have categories A, B, C and D. And also categories 1, 2, 3 and 4. I have posts that can belong to any four of these categories. But I want to exclude anything in categories B, 4 and D from the homepage (and only from the homepage), even though they are also in other categories. I've been trying plugins and custom code and googling for hours, and I just can't get this to work. The last batch of attempts were variations on this:                <?php $query = new WP_Query( 'cat=-32,-99' ); ?>      <?php if ( $query->have_posts() ) : while ( $query->have_posts() ) : $query->the_post(); ?>      <?php if (! in_category ('-32')); ?>      <?php x_get_view( 'ethos', 'content', get_post_format() ); ?>      <?php endif; ?>      <?php endwhile;       wp_reset_postdata();      else : ?>
<?php _e( 'Sorry, no posts matched your criteria.' ); ?>
      <?php endif; ?>      Any suggestions would be most welcome.


title: Custom Reset Password & Forgot Password Front End Forms

text: I've successfully been able to redirect the default wp_login.php used for all login/registration/password reset to custom pages with the following filters:               add_filter ( 'login_url', xxfunctionnamexx )      and               add_filter ( 'register_url', xxfunctionnamexx )      I've created the frontend login from with the default `wp_login_form()` function and the registration form with Gravity Forms. However, I'm really have trouble with the "reset password" form and "forgot password" form. I've been able to get the redirect working with the `lostpassword_url` filter (see below).               function custom_lostpassword_url( $register_url='', $redirect='' ) {       $page = get_page_by_path( 'reset-password' );       if ( $page ) {         $lostpassword_url = get_permalink( $page->ID );         if (! empty( $redirect ) )             $lostpassword_url = add_query_arg( 'redirect_to', urlencode($redirect), $lostpassword_url );       }         return $lostpassword_url;     }               add_filter( 'lostpassword_url', 'custom_lostpassword_url', 10, 2 );      However, I'm having trouble getting the "forgot password" to work. I've tried using this method - Check for correct username on custom login form \- but it throws an "expired key" error when the link retrieved in email is clicked. Then I tried this method, which works (no expired key). However, it redirects back to the default "reset password" page (within wp-login.php) - where the user can create a new password. I'd like to create a frontend form for this, too. Can anyone help - or is this simply not doable?


title: SQL: Select wordpress posts with given text string and add a custom field to them?

text: I want to select all wordpress posts that have a certain text string. Then to add a custom field to all those posts. Here is what I figured out so far but it doesn't work               INSERT INTO wp_postmeta (post_id, meta_key, meta_value)     SELECT ID AS post_id,             'customer_reviews' AS meta_key,             'On_or_delete' AS meta_value     FROM   wp_posts      WHERE  ID IS IN            (SELECT post_id              FROM wp_posts             WHERE post_content LIKE '%Customer Reviews%')            AND post_type = 'post';      Anyone know how to do this please?


title: Customized theme Custom Header HTML

text: I have upgraded from 3.5.1 to 3.5.2 and the problem I am facing is with my header that I am using customized theme and Custom Header HTML that when I was using 3.5.1 it was working fine and I could use header and sliders on every page of my website but after the upgrade I am unable to save any code inside this box and hence unable to work with headers. But my old headers which were made in version 3.5.1 are working fine but what pages I made in version 3.5.2 I am unable to see the header as unable to save the code in custom header HTML box for example 1.) www.geekssquadsupport.com you will be able to see the header that page was made in version 3.5.1 2.) http://geekssquadsupport.com/testheader/ here there is no header cause this is not working


title: Add input field to 'Pages > Edit Page' through functions.php

text: _Original Question:_ I'm trying to add an input field to 'Pages > Edit Page'. The use of this input field will be for a user to add an ID of a slider, so that that slider will be page specific. Example:   * User adds slide ID to input field on Edit Page screen.   * Page pulls in that ID. * * * Thank you to all of you who have responded, you are a wonderful community, I have received excellent help from this site, thank you! **FINAL RESULT** **functions.php**               // Add custom Slider ID field to 'Edit Page'     add_action( 'add_meta_boxes', 'cd_meta_box_add' );     function cd_meta_box_add() {         add_meta_box( 'my-meta-box-id', 'Slider', 'cd_meta_box_cb', 'page', 'normal', 'high' );     }     function cd_meta_box_cb( $post ) {         $values = get_post_custom( $post->ID );         $text = isset( $values['my_meta_box_text'] ) ? esc_attr( $values['my_meta_box_text'][0] ) : '';         wp_nonce_field( 'my_meta_box_nonce', 'meta_box_nonce' );         ?>         <p>             <label for="my_meta_box_text">Add a slider ID</label>             <input type="text" name="my_meta_box_text" id="my_meta_box_text" value="<?php echo $text; ?>" />         </p>         <?php        }     add_action( 'save_post', 'cd_meta_box_save' );     function cd_meta_box_save( $post_id ) {         // Bail if we're doing an auto save         if( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) return;         // if our nonce isn't there, or we can't verify it, bail         if( !isset( $_POST['meta_box_nonce'] ) || !wp_verify_nonce( $_POST['meta_box_nonce'], 'my_meta_box_nonce' ) ) return;         // if our current user can't edit this post, bail         if( !current_user_can( 'edit_post', $post_id ) ) return;         // now we can actually save the data         $allowed = array(              'a' => array( // on allow a tags                 'href' => array() // and those anchords can only have href attribute             )         );         // Probably a good idea to make sure your data is set         if( isset( $_POST['my_meta_box_text'] ) )             update_post_meta( $post_id, 'my_meta_box_text', wp_kses( $_POST['my_meta_box_text'], $allowed ) );     }      **Page.php**               <?php echo do_shortcode( '[cycloneslider id="' . get_post_meta(get_the_ID(), 'my_meta_box_text', true) . '"]'); ?>


title: Split post edit screen into sub-edit screens for users, is this good or bad, and is it possible?

text: I am working on my user back end access in which users can control a few posts based on post type as well as submit posts in a few other areas (Guides and Encyclopedia entries). The single post types they have access to have a large amount of meta-data and taxonomies to choose from/enter data into. I was thinking of splitting the post edit screen into separate "sub-edit" screens to divide up the entry input.   1. Is this a good idea?   2. How should I go about setting it up? Set up Ideas: 2a. I can hide certain parts of the edit screen if I pass a $_GET in the url OR 2b. I can set up customized edit forms via add_submenu_page function. Which I used when first trying to set up user access from the front end - abandoned this idea as I could not get the WYSIWYG editor to function on the front end. Any suggestions or insights are greatly appreciated. Thanx!


title: what is the best practice for including 'wp-includes' classes

text: I have a class 'wp_php_flickr' which will use the wordpress core class 'WP_HTTP' in a plugin which i'm writing               if( !class_exists( 'WP_Http' ) ) {         require_once( WP_INSTALL_DIR.'\wp-includes\class-http.php');     }          class wp_php_flickr {     ...     }      As i'm testing i'm noticing that i am required to include more and more core classes, which the WP_HTTP class is dependent on               require_once( WP_INSTALL_DIR.'\wp-includes\plugin.php');     require_once( WP_INSTALL_DIR.'\wp-includes\general-template.php');     require_once( WP_INSTALL_DIR.'\wp-includes\link-template.php');     require_once( WP_INSTALL_DIR.'\wp-includes\option.php');     require_once( WP_INSTALL_DIR.'\wp-includes\cache.php');      I'm wondering is there a smarter or better way to ensure the required dependent classes are available automatically to my class?


title: How do I set up single sign on for multiple WP installs across the same domain?

text: I want to set up multiple WP installs in a few subdirectories. For example, one WP install would live at mydomain.com/blog. Another WP install might live at mydomain.com/project1 and another might live at mydomain.com/project2. I'd like to enable single sign on so that I only have to issue one username and password for a user across these multiple WP installs. How might I accomplish this? FYI...I've considered enabling MultiSite, but I decided against it for the following reason; > While permalinks will continue to work, the main blog (i.e. the first one > created) will have an extra entry of blog, making your URLs appear like > domain.com/blog/YYYY/MM/POSTNAME. > > This is by design, in order to prevent collisions with SubFolder installs. > Currently there is no easy way to change it, as doing so prevents WordPress > from auto-detecting collisions between your main site and any subsites. This > will be addressed, and customizable, in a future version of WordPress. Thanks in advance for any assistance! Eddie


title: How to add an <img> tag when a menu item is a dropdown(or has a sub-menu)

text: > **Possible Duplicate:**   >  Adding a class (arrows) to main menu links that have children? I have two, very basic css dropdowns in my menu. I want to be able to add an arrow next to the dropdowns like shown below. ![ss](http://i.stack.imgur.com/9cctS.jpg) What I want to do is basicly use wp_nav_menu's 'after' argument, only if the item has a submenu. I'm guessing I need to add a filter but I have no idea how that works. It would be great if someone could point me in the right direction. Thanks.


title: Custom youtube shortcode that uses $content

text: I wanna make a simple shortcode that returns the youtube link in a specified size and use the content. Something like:               [yt]http://youtu.be/Nl29v5pfxTw[/yt]      I have this code, but I want to simplify it:                   function youtube($atts) {             extract(shortcode_atts(array(                     "value" => 'http://',                     "width" => '620',                     "height" => '350',                     "name"=> 'movie',                     "allowFullScreen" => 'true',                     "allowScriptAccess"=>'always',             ), $atts));             return '<object style="height: '.$height.'px; width: '.$width.'px"><param name="'.$name.'" value="'.$value.'"><param name="allowFullScreen" value="'.$allowFullScreen.'"></param><param name="allowScriptAccess" value="'.$allowScriptAccess.'"></param><embed src="'.$value.'" type="application/x-shockwave-flash" allowfullscreen="'.$allowFullScreen.'" allowScriptAccess="'.$allowScriptAccess.'" width="'.$width.'" height="'.$height.'"></embed></object>';     }     add_shortcode("yt", "youtube");      The problem is that with this code I need to use [yt value="http://youtu.be/Nl29v5pfxTw"] and I want to just use the [yt]$content[/yt] How I can achieve that? Thanks


title: How to get all images url from gallery?

text: I created gallery in my post (in my custom post type) and now I need to get url of images from this gallery in my template file. Does anyone know how to do it? Thx for your time.


title: How to process content in a widget?

text: > **Possible Duplicate:**   >  Is There A Hook To Process The Content Of The Text Widget? I have created a plugin that uses tokens in the body content to dynamically insert certain content. For example: %%keyword%% At page request, that would get replaced with a keyword specified in the incoming URL. I would like to be able to use these tokens in a widget and have them processed the same, but my plugin only knows about `the_content` and I haven't been able to figure out, how to tell it to parse the content of widgets as well, before final page render. How would this be done? I suppose it can be done more easily with shortcodes, but I'd like to stay consistent with my token usage. Appreciate any suggestions! EDIT: Minutes after posting I found this post which has given me what I need: Is There A Hook To Process The Content Of The Text Widget? Thanks anyway all!


title: How do I put my comment form above the comments?

text: The default way to do things seem to have the comment form below the comments. I'd like to have the form at the top. How do I achieve this?


title: use %post_title% in description (All in one SEO Pack)

text: I am not able to use %post_title% in the description part ,it's displaying as %post_title% itself.. we can use other tags like %blog_title% , but the %post_title% is not working .. please help.. thanks


title: WYSIWYG-able Footnote Plugin

text: Is there a WP plugin that allows user to edit in-page footnotes in WYSIWYG manner? No weird syntax. No HTML pane. **Update:** Perhaps I'm missing something, as I'm new to WP. All footnote plugins that I saw use custom syntax. Example:               Blah blah blah ((my footnote)) blah      Other:               Blah blah blah [ref]my footnote[/ref]      I need plugin that will allow user to edit footnotes visually, like Word does.


title: Presentation vs Content in WP DB-Tables

text: Presentation vs Content in WP DB-Tables Is there a clean separation between the WP tables involved with presentation vs content? I would like to take my time working up presentation changes, such as a new theme, in a testing ("staging") site initialized to a snapshot of the live site. When I am done, I want to copy over the relevant data to my live site, but I don't want to lose any content changes (pages or blog entries) that were made during the development. I know I need to copy over the wp-content directory and to install the new theme settings. But that's not the whole story. Some presentation items that I know are not covered include the Media Library, Widgets, and Background Images. I would hope that there are some tables that I can migrate to take care of these (and perhaps other) presentation aspects without regressing the content. So my question boils down to: Which DB-tables control presentation and which control content?


title: How often is functions.php loaded?

text: Trying to get my head round functions.php and am wondering how often it is loaded?


title: Tags page not for post

text:
According with Wordpress: category page not for post's. I use wordpress to create web sites for flash games, so I don't have certain page for post's. I add each game by post-new.php?post_type=game and u can see it's not the regular post for wordpress. Now I try make the same for tags, but stuck again. what I have now:               <?php     if (is_page() ) {     $tag = get_post_meta($posts[0]->ID, 'tag', true);     }     if ($tag) {     $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;     $post_per_page = 4; // -1 shows all posts     $do_not_show_stickies = 1; // 0 to show stickies          $args=array(     'post_type' => 'game',     'tag__in' => array($tag),     'orderby' => 'date',     'order' => 'DESC',     'paged' => $paged,     'posts_per_page' => $post_per_page,     );     $temp = $wp_query;  // assign orginal query to temp variable for later use        $wp_query = null;     $wp_query = new WP_Query($args);      if( have_posts() ) :      while ($wp_query->have_posts()) : $wp_query->the_post(); ?>      <div <?php post_class() ?> id="post-<?php the_ID(); ?>">
<a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?    php the_title_attribute(); ?>"><?php the_title(); ?>

           <?php the_content('Read the rest of this entry »'); ?>

<?php the_tags('Tags: ', ', ', '
'); ?> Category in <?php the_category(', ') ?> |

     <?php endwhile; ?>

<?php next_posts_link('« Older Entries') ?>

<?php previous_posts_link('Newer Entries »') ?>

     <?php else : ?>
Not Found

Sorry, but you are looking for something that isn't here.
     <?php get_search_form(); ?>           <?php endif;            $wp_query = $temp;  //reset back to original query          }  // if ($tag)      Basicly, I've just change '$cat' for '$tag' according with codex, but I have only page with search form from here
Not Found

Sorry, but you are looking for something that isn't here.
      <?php get_search_form(); ?>      and don't nave any game for certain tags?


title: When does WordPress automatically enqueue jQuery?

text: I understood that WordPress **ALWAYS** enqueues jQuery on all themes, thus it's reduntant to enqueue another jQuery with the same version. However, while developing a theme, for testing purposes I moved it to a subdomain (same domain, another WP installation, no content but the "Hello World" post). While the first enqueued normally the jQuery, the second stopped some functionalities and looking inside I've found that WordPress was not including jQuery automatically anymore. The question is: Does WordPress wait for something (don't know, maybe a minimum of widgets on widget areas, menus, etc) to call the script? To make sure, do I have to enqueue the native jQuery manually? I'm developing a theme with the purpose to sell it on Theme Forest and they only allow the native WP jQuery (no way to dequeue it and add from another resource). I'm using Wordpress 3.8


title: How to delete terms on plugin deactivate?

text: I created a list of terms under 'category' when activate plugin. When deactive the plugin, I want to delete them. My function doesn't work, how to make this working?               function ppcontent_deactivate() {              $terms = get_terms( 'category' );              foreach( $terms as $term ){             wp_delete_term($term->term_id,'category');         }     }     register_deactivation_hook( __FILE__, 'ppcontent_deactivate' );


title: Link Category Description

text: I'm pulling my hair out over this. In the Links manager, you can enter a description for the category (in addition to the link itself). However, in wp_list_bookmarks, there is no way to call this value anywhere. So how can I get it? I know it's in the term_taxonomy table, under link_category. So is there a function that could be written to retrieve this value dynamically (i.e. not having to declare each link category independently)


title: Orderby in Query Posts affected by operating system?

text: I have the following post query:               query_posts( array(           'post_type' => 'maze-schedule',           'order' => 'ASC',           'orderby' => 'meta_value_num',           'meta_key' => 'course_date'         ) );         ?>      This works fine and the posts are ordered by my "course_date" meta value. However, when two posts with the same meta value for "course_date" exist - they are displayed in one order when accessing my site on a Mac, and another when accessing via a PC. Would the OS have any effect on how the results are displayed? Im guessing WP reverts to some default order when the orderby meets two posts with the same value? Many thanks in advance.


title: How to add plugins to wordpress theme?

text: I planned to develop wordpress themes commercially.. I just want to know the easy method to add plugins to my wordpress theme which I am developing.. can any one suggest me the simple steps.. and I need possible methods that I can use effectively..


title: Can I force a metabox to be in one column?

text: Suppose I created a custom metabox for the add/edit post page that uses a wide width (not suitable for being in the sidebar), is there a way of keeping it in the middle column only and sortable while not allowing the user to drag it to the side bar?


title: featured images - custom links

text:
I'm using the Fusion Elegant Theme, but am having an issues with the featured slider. I added custom "read more" links for my slides. However, where a featured image is assigned, clicking on that image does not link to my specified custom link, but merely navigates to the featured post. I have posted what I believe to be the relevant code below. Any help is greatly appreciated!               et_get_option('fusion_feat_pages') ),                                 'posts_per_page'    => (int) $featured_num                             )                     )                    );             }                  while ( $featured_query->have_posts() ) : $featured_query->the_post();                 $post_id            = get_the_ID();                      $bg = et_get_option( 'fusion_bg_image' );                 if ( '' == $bg ) $bg = get_template_directory_uri() . '/images/bg_fusion.jpg';                      $slide_bg           = ( $slide_bg_url = get_post_meta( $post_id, '_et_slide_bg', true ) ) && '' != $slide_bg_url ? $slide_bg_url : $bg;                      $slide_subtitle     = get_post_meta( $post_id, '_et_slide_subtitle', true );                 $slide_more_text    = get_post_meta( $post_id, '_et_slide_more_text', true );                 $slide_more_link    = get_post_meta( $post_id, '_et_slide_more_link', true );                 $more_link          = '' != $slide_more_link ? $slide_more_link : get_permalink();         ?>             <div class="et-slide"<?php if ( '' != $slide_bg ) echo ' style="background-image: url(' . esc_url( $slide_bg ) . ');"'; ?>>

<a href="<?php echo esc_url( $more_link ); ?>"><?php the_title(); ?>
                     <?php if ( '' != $slide_subtitle ) { ?>
<?php echo esc_html( $slide_subtitle ); ?>
                     <?php } ?>
<?php truncate_post( 180 ); ?>
                              <a href="<?php echo esc_url( $more_link ); ?>" class="more">                             <?php if ( '' != $slide_more_text ) echo esc_html( $slide_more_text ); else esc_html_e( 'Read More', 'Fusion' ); ?>
                       <?php                     $width = (int) apply_filters( 'slider_image_width', 535 );                     $height = (int) apply_filters( 'slider_image_height', 572 );                     $title = get_the_title();                     $thumbnail = get_thumbnail( $width, $height, '', $title, $title, false, 'Featured' );                     $thumb = $thumbnail["thumb"];                 ?>
                         <a href="<?php the_permalink(); ?>"><?php print_thumbnail( $thumb, $thumbnail["use_timthumb"], $title, $width, $height, '' ); ?>


title: $wpdb->insert - inserting multiple rows

text: How do I use `$wpdb->insert` to insert multiple rows. Here is my code.               for($i=0; $i<=$urlCount; $i++) {        $stat = $wpdb->insert(             'WP_URLS',             array(                 'POSTID' => $post->ID,                 'URL' =>   $_POST['url'.$i]             )         );     }      This code works only for the first insert (ie, when `$i = 0` , when value is _`url_0`_ ). Sometimes the URL count will be more than 100 and sometimes it will be zero. So instead of writing the code for 100 times, I just want to have a simple loop that works for any number of records. Thats the reason I went for loop. Thank you for the help. The table structure is               CREATE TABLE WP_URLS (        POSTID BIGINT NOT NULL,        URL VARCHAR(254)     );


title: How to add permalinks to contact form 7

text: I´m wondering if I can get the Post ID or permalink to be send as part of subject o message content of contact form7, any Idea?


title: Creating Tables on Network Activation

text: I'm working on a plugin which creates a new table. I've got it working fine on a single site install, but I'm not so sure about multisite. How do I create a table for each blog on network activation?


title: "switchEditors is not defined" with wp_editor() in jQuery UI tabs

text:
Making a WordPress plugin, using WordPress 3.5.2 I'm using wp_editor() on the front end, inside jquery UI tabs [ajax loading tabs + 2 editors on the same panel], and I'm getting the following error, when clicking visual.               switchEditors is not defined      I've even tried adding this; it errors out tinyMCE is not defined. this is my code:

<a href="<?php echo get_option( 'siteurl' ).'/?wpsca=wpscalist';?>" title="manage list"><?php echo __('Manage Pages','wpsca_lang');?>

<a href="<?php echo get_option( 'siteurl' ).'/?wpsca=wpscaaddedit';?>" title="manage addedit"><?php echo __('Add Page','wpsca_lang');?>

<a href="<?php echo get_option( 'siteurl' ).'/?wpsca=wpscasettings';?>" title="manage settings"><?php echo __('Settings','wpsca_lang');?>

loading...

loading...

loading...

      And I'm picking the tabs up on init; Any direction would be appreciated


title: IE 301 Redirect Issue - WordPress

text: Hoping someone might be able to help... I don't think this is a WordPress issue, hence posting here instead... I run the latest ISPConfig version, with Apache and MySQL, and have an odd issue with a site I host. In Chrome, the WordPress site (with Permalinks on) works correctly, however in IE it doesn't. It will load the homepage correctly, but any other pages take a while to load, then IE shows a generic "This page can't be displayed" error. I started by removing all WordPress plugins, but the error didn't go away. Switching Permalinks off solves the issue. Switching Permalinks back on brings the issue back. I've even gone as far as scrapping the WordPress install, and starting again, in case any plugins had left some rubbish behind that was causing the problem. However, my "clean install" has this problem now. If I look at the access logs after attempting to access a page with IE, all I see this;               x.xx.xx.xxx - - [15/Jul/2013:21:34:18 +0100] "GET /category/blog HTTP/1.1" 301 20 "-" "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; WOW64; Trident/6.0)"     x.xx.xx.xxx - - [15/Jul/2013:21:34:19 +0100] "GET /category/blog HTTP/1.1" 301 20 "-" "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; WOW64; Trident/6.0)"     x.xx.xx.xxx - - [15/Jul/2013:21:34:19 +0100] "GET /category/blog HTTP/1.1" 301 20 "-" "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; WOW64; Trident/6.0)"     x.xx.xx.xxx - - [15/Jul/2013:21:34:19 +0100] "GET /category/blog HTTP/1.1" 301 20 "-" "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; WOW64; Trident/6.0)"     x.xx.xx.xxx - - [15/Jul/2013:21:34:19 +0100] "GET /category/blog HTTP/1.1" 301 20 "-" "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; WOW64; Trident/6.0)"     x.xx.xx.xxx - - [15/Jul/2013:21:34:19 +0100] "GET /category/blog HTTP/1.1" 301 20 "-" "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; WOW64; Trident/6.0)"     x.xx.xx.xxx - - [15/Jul/2013:21:34:19 +0100] "GET /category/blog HTTP/1.1" 301 20 "-" "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; WOW64; Trident/6.0)"     x.xx.xx.xxx - - [15/Jul/2013:21:34:19 +0100] "GET /category/blog HTTP/1.1" 301 20 "-" "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; WOW64; Trident/6.0)"     x.xx.xx.xxx - - [15/Jul/2013:21:34:19 +0100] "GET /category/blog HTTP/1.1" 301 20 "-" "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; WOW64; Trident/6.0)"     x.xx.xx.xxx - - [15/Jul/2013:21:34:19 +0100] "GET /category/blog HTTP/1.1" 301 20 "-" "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; WOW64; Trident/6.0)"     x.xx.xx.xxx - - [15/Jul/2013:21:34:19 +0100] "GET /category/blog HTTP/1.1" 301 20 "-" "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; WOW64; Trident/6.0)"     x.xx.xx.xxx - - [15/Jul/2013:21:34:19 +0100] "GET /category/blog HTTP/1.1" 301 20 "-" "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; WOW64; Trident/6.0)"     x.xx.xx.xxx - - [15/Jul/2013:21:34:19 +0100] "GET /category/blog HTTP/1.1" 301 20 "-" "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; WOW64; Trident/6.0)"     x.xx.xx.xxx - - [15/Jul/2013:21:34:19 +0100] "GET /category/blog HTTP/1.1" 301 20 "-" "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; WOW64; Trident/6.0)"     x.xx.xx.xxx - - [15/Jul/2013:21:34:19 +0100] "GET /category/blog HTTP/1.1" 301 20 "-" "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; WOW64; Trident/6.0)"     x.xx.xx.xxx - - [15/Jul/2013:21:34:19 +0100] "GET /category/blog HTTP/1.1" 301 20 "-" "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; WOW64; Trident/6.0)"     x.xx.xx.xxx - - [15/Jul/2013:21:34:19 +0100] "GET /category/blog HTTP/1.1" 301 20 "-" "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; WOW64; Trident/6.0)"      etc etc Accessing the site with Chrome works fine, and I see correct logs in the access.log file. I have two other WordPress sites, both on top level domains, and they work correctly. I thought it might be an odd issue with the site being on a subdomain, so instead of using a subdomain acting as a website (setup as a website through ISPConfig), I tried with a manual subdomain - ie, a redirect into a directory. The site loaded fine for a couple of pages, and then suddenly stopped working, and 301 errors were thrown up. Any help would be greatly appreciated, as this is extremely frustrating.


title: WordPress Admin Bar Not Displaying Both Custom Drop-down Menus

text: I'm having trouble displaying two custom drop-down menus in the WP admin bar. What I want is the first drop-down to display the back-end (editing part) links of every page and the other to display the front-end links of every page. Right now, only the last foreach statement being called displays. Any suggestions are much appreciated.               function admin_bar_link() {          global $wp_admin_bar;     if ( !is_super_admin() || !is_admin_bar_showing() )     return;          $pages = get_pages();     $nurs = get_site_url();          $wp_admin_bar->add_menu( array(         'id' => 'this',         'title' => __($nurs),         'href' => $nurs     ) );     $wp_admin_bar->add_menu(array (         'id' => 'edit_pages_links',         'title' => __('Edit Pages'),     'href' => false     ) );     $wp_admin_bar->add_menu(array (         'id' => 'view_pages_links',         'title' => __('View Pages'),         'href' => false     ) );          // added edit pages link 12-20-13 mlm     foreach ( $pages as $page ) {         $title = $page->post_title;         $url = get_permalink ( $page->ID )  . 'wp-admin/post.php?post=' . $page->ID . '&action=edit'; //edit post url                  $wp_admin_bar->add_menu ( array ( //display top-level menu item 'edit pages'             'title' => $title,             'href' => $url,             'parent' => 'edit_pages_links'             )         );          }//end foreach            foreach ( $pages as $page ) {     $title = $page->post_title;     $url = get_permalink ( $page->ID ) . '?p='. $page->ID;              $wp_admin_bar->add_menu ( array ( //display top-level menu item 'edit pages'             'title' => $title,             'href' => $url,             'parent' => 'view_pages_links'             )         );                                }//end foreach           }     add_action('admin_bar_menu', 'admin_bar_link');


title: Deprecating functions in a plugin class

text: I'm updating one of my plugins and I'm a little stuck with deprecating functions. Originally, my plugin had a global variable and the plugin's main class was instantiated and stored in the global variable. This way users could use the global to access functions in the plugin class.               $GLOBALS['my_custom_plugin'] = new my_custom_plugin();      Then, for example, in my FAQ I had code that showed how to remove one of my class' functions from a specific hook and add to to a different hook:               function move_input(){          global $my_custom_plugin;         remove_action( 'before_main_content', array( $my_custom_plugin, 'display_input') );         add_action( 'after_main_content', array( $my_custom_plugin, 'display_input' ) );     }     add_action( 'wp_head' , 'move_input' );      Now, in my update the `display_input()` function has been moved to another class and I want to let people know how to access it. I tried replacing the original function (in the main plugin class) with the following deprecation notice:               public function display_input() {          _deprecated_function( 'display_price', '2.0', 'my_custom_plugin()->display->display_input' );         return $this->display->display_input();     }      However, the `add_action` and `remove_action` functions don't seem to trigger the deprecation notice. Weirdly, completely removing the function doesn't cause an error either even though `array( $my_custom_plugin, 'display_input')` doesn't exist. If someone tries to access the function directly:               $my_custom_plugin->display_input();      Then I do see the debug notices. Is this the expected outcome for `_deprecated_function()`? or am I missing something? Is it possible to show a debug notice when someone tries to remove or add an action using a deprecated function? **Update** I realized that I was simply not seeing the debug message for the `add_action` as I was adding it pretty low on the page. #facepalm! However, I am still not seeing any debug notice for the `remove_action`.


title: Show latest and related articles from 3 different blogs

text: Say I have 3 sites, abc.com, def.com and xyz.com. And all the 3 sites have different wordpress installation and different databases. Now What I want to show all the latest articles of all three sites in sidebar of main site say abc.com. Secondly in story page I want that related articles should come from all the three sites. Is this possible from any plugin? I am not talking about multisite. Regards Girish


title: Would manually deleting the dumping data fix a "#1062 - Duplicate entry '1' for key 'PRIMARY'" phpMyAdmin error?

text: I'm new to PHP! I'm trying to import an SQL database file into myPhpAdmin for a WordPress I'm migrating, but I keep getting this error message:               SQL query:          `-- -- Dumping data for table `wp_commentmeta` -- INSERT INTO `wp_commentmeta` (`meta_id`, `comment_id`, `meta_key`, `meta_value`) VALUES (1, 3, 'rating', '5'), (37, 39, 'rating', '5'), (35, 37, 'is_customer_note', '0'), (4, 6, 'is_customer_note', '0'), (5, 7, 'is_customer_note', '0'), (6, 8, 'is_customer_note', '0'), (7, 9, 'is_customer_note', '0'), (8, 10, 'is_customer_note', '0'), (9, 11, 'is_customer_note', '0'), (10, 12, 'is_customer_note', '0'), (11, 13, 'is_customer_note', '0'), (34, 36, 'is_customer_note', '0'), (13, 15, 'is_customer_note', '0'), (14, 16, 'is_customer_note', '0'), (15, 17, 'is_customer_note', '0'), (16, 18, 'is_customer_note', '0'), (17, 19, 'is_customer_note', '0'), (18, 20, 'is_customer_note', '0'), (19, 21, 'is_customer_note', '0'), (45, 44, 'rating', '4'), (46, 45, 'rating', '4'), (22, 24, 'is_customer_note', '0'), (23, 25, 'is_customer_note', '0'), (24, 26, 'is_customer_note', '0'), (25, 27, 'is_customer_note', '0'), (26, 28, 'is_customer_note', '0'), (2[...]          MySQL said: Documentation          #1062 - Duplicate entry '1' for key 'PRIMARY'      From looking at the SQL file, I see:               INSERT INTO `wp_commentmeta` (`meta_id`, `comment_id`, `meta_key`, `meta_value`) VALUES      followed by a list of table data with different values. Would deleting this section of code fix the error I'm getting?


title: Add content before/after admin post wp-list-table

text:
I know there are two hooks to add content before and after a taxonomy wp-list- table. Is there an action to add content after the post type wp-list-table on the edit.php page? * * * For $taxonomy List Tables:               add_action( 'category' . '_pre_add_form', 'copy_above_form' );     function copy_above_form( $taxonomy ) {         echo '
Above the WP-List-Table
';     }          add_action( 'after-' . 'category' . '-table', 'copy_below_table' );     function copy_below_table( $taxonomy ) {         echo '
Below the WP-List-Table
';     }      Reference: https://trepmal.com/action_hook/after-category-table/ Thanks!


title: localhost/wp-admin on my local redirects to production site's /wp-admin

text: So when I go on localhost, my development environment loads fine. But when I try to go to `/wp-admin`, I get redirected to the production URL `mysite.com/wp-admin`. Where is this being set? I don't want to be redirected.