Polls with respective comments?

I am using wp-polls plugin. It's working fine. Instead I need some more things in this which are :   1. I want to use comments with each poll. (I think this can be possible when adding A New Poll, A New Page will generate) so I can get comments on that Poll via that Page.   2. When I click on Polls Archive link then all Polls are visible it's fine but I want to see their respective comments on that Polls Archive Page.   3. How to get latest Poll with it's comments ? Please give me any solution either with this plugin or any other way to manage the Polls with respective comments.


Taxonomy archive 404ing (not term archive)

I may have just dug too deep into WordPress lately that I am not able to free my head & don't get this working as supposed to do. I want a simple taxonomy archive listing all taxonomy terms (not a term's archive), while it only 404s on my end. This is how it is set up: I have a CPT **'travel'** and a taxonomy called **'actions'** that classify different kind of travel options (e.g. by bike, sailing etc.). Term archives (with a taxonomy-actions.php template) work just fine. The URL is like www.domain.com/actions/by-bike. However, when I try to pull the taxonomy archive, which should then be located at www.domain.com/actions, I get a 404. Is there something basic I am missing or doing wrong? Isn't the taxonomy-actions.php supposed to be used for the taxonomy archive in the first place?


Running WP Cron on specific local time

The scenario is to run insert_post function every midnight (00:00) of local time. Must run daily on weekday.               function add_daily_task(){         if((date('l', time()) != 'Saturday') || (date('l', time()) != 'Sunday')){              // insert post         }     }          if(!wp_next_scheduled( 'add_daily_task_schedule')){         wp_schedule_event(time(), 'daily', 'add_daily_task_schedule');         // how should change time() to meet my local schedule?     }          add_action('add_daily_task_schedule', 'add_daily_task');


Twenty Twelve Calender Widget post titles creating disturbance

In my modified Twenty Twelve theme, when I'm hovering onto the calender widget's date, there is a acronym-like balloon showing that date's post titles. Thing really is an anchor title:                       23     	      So when I'm hovering onto date 23, it's echoing like an acronym:               23     ---------------      post title 1      post title 2     ---------------      Problem is: My client doesn't want this. If I can modify the default calendar widget, then I can delete the anchor title, and it will solve the problem. But I can't edit the default calendar widget.   * **QUESTION 1:** HOW TO EDIT WORDPRESS DEFAULT CALENDAR WIDGET? Otherwise, I can make CSS for the specific title like this one. I did this like:               a[title]:hover:after {       content: attr(title);       display: none;     }      and/or               a[title]:hover:after {           content: attr(title);           visibility: hidden;         }      But failed. So, alternatively, the second question can be:   * **QUESTION 2:** HOW TO HIDE THE ANCHOR TITLE USING CSS? Thanks in advance.


Custom Post Type - Duplicate Page Slugs

I have 2 custom post type registered in my functions file, **sectors** and **projects**. There are pages with the same name and hence URL in both post type. My problem is that WordPress wont allow the same URL's for a page, these URL's are a requirement so need to find a fix. Example: **Sectors**   * Apples (apples)   * Oranges (oranges)   * Bananas (bananas) **Projects**   * Apples (apples-2)   * Oranges (oranges-2)   * Bananas (bananas-2) **Code**               register_post_type( 'Sectors',         array(             'labels' => array(                 'name' => __( 'Sectors' ),                 'singular_name' => __( 'Sector' )             ),         'public' => true,         'rewrite' => array('slug' => 'sector'),         'has_archive' => false,         'hierarchical' => true,         'capability_type' => 'page',         'supports' => array('title','editor','thumbnail','page-attributes'),         'menu_icon' => get_template_directory_uri().'/images/wordpress/cpt-sectors.png'         )     );          register_post_type( 'Projects',         array(             'labels' => array(                 'name' => __( 'Projects' ),                 'singular_name' => __( 'Project' )             ),         'public' => true,         'rewrite' => array('slug' => 'project'),         'has_archive' => false,         'hierarchical' => true,         'capability_type' => 'page',         'supports' => array('title','editor','thumbnail','page-attributes'),         'menu_icon' => get_template_directory_uri().'/images/wordpress/cpt-projects.png'         )     );      I need a way for this to work, and I am hoping there is a simple answer that I have missed in my hours of Googling. Note: Please refrain from just posting "This cant be done" or any elongated/messy solutions like hacking the core. There must be a way for WordPress to allow this.


Post meta not appear in admin edit menu for custom post type

I have a custom post type 'Vehicles' within I have a taxonomy 'cars'. Also a front end adding from a html form. After the form is send, here is a sample what actually is happening. My idea is to hook my custom fields/post meta boxes to admin edit area of that specific post type. Any ideas?               if(isset($_REQUEST['cars'])){ // checking which form is coming from post array              $make = $_POST['make']; // getting the field from the form and pass it to a variable         $new_post = array( // collecting the information about the new post                  'post_title'    =>   $title,                  'post_content'  =>   $description,                  'tax_input' =>   array('types' => array('cars')),                    'post_status'   =>   'pending',                            'post_type' =>   'vehicles'                    );                $pid = wp_insert_post($new_post); // pass the array data from above to the function that actually save the post           wp_set_object_terms($pid, 'cars', 'types', true); // setting the taxonomy for that specific post                add_post_meta($pid, 'car_make', $make, true); // adding the meta information about the post. THIS IS WHAT I WANT TO APPEAR IN ADMIN EDIT MENU               }


wp_insert_post() Callback?

After I added a post by wp_insert_post(); Any callback after I added ? I need permalink of added post. I have idea only search by title and post-type (I use custom post-type in my case), But any better function ?


Modify / Rewrite single template url structure

Is it possible to add the post category name to the the WordPress single template url structure if i am not using category pages to build the site menu? from www.domain.com/single-post-title to www.domain.com/category-name/post-title I am using a custom page template that is loading posts from a specific category. Would I have to edit the urls in the .htaccess file, or is it possible to do this using WP_Rewrite?


Adding an image and background colour to confirmation email

When a user registers for my site they get an email showing them their username and password but I would like to know how I can add a background color and image to these emails. I use the WP Register Plus Redux plugin to register users by the way. I've tried using CSS. This is the code that I tried:               body {background-color:#b0c4de;}


Is it good practice to search for custom posts based on custom field values?

I am building a theme for a local roofing company and we need to implement a solution for users to be able to search through custom posts and find what they're looking for based on custom field values. For example, a user should be able to select that they are looking for all posts that match:   * roofColor = green   * roofType = shingles   * roofCity = chicago   * etc.. There will be hundreds of projects (custom post entries) to search through. I'm interested in best practices here. **Is it okay to be using custom fields for my custom posts in this example** and to search for posts that have the matching custom field values? I have heard that the way wordpress stores values like this in the db would make it inefficient or slow, so **I'm wondering if it would be better to build my own database to handle the special values for each roofing project?** Thank you for your time and insight, it's greatly appreciated!


How can I get plugin meta data without knowing the plugin folder?

I am looking to get meta data about an installed plugin from another plugin. Theoretically, to get the version, I could do:               $data = get_plugin_data( 'expected_plugin_folder_name');     $version = $data['version'];      But, this wouldn't work if the end user had changed the name of the plugin that I'm looking to get the meta data on was installed in. I think the solution is to search in the array returned from `get_plugins()`. The sticky part is the array keys are named for the path, relative to the plugin directory of the plugin file, which brings me back to the same issue as before--the end-user might have changed the directory name of the plugin. Is there anyway to get the meta data without having to specify the plugin folder? Possibly by specifying slug, uri, name, etc...


Using Foundation 5 off-canvas-menu with Wordpress

I am trying to integrate Zurb Foundation 5 into a Wordpress theme. I can get it working fine but I'm puzzled by a seeming issue which make it unworkable in Wordpress. Please see this code for making the off-canvas menu work, and following the code I outline my question:

Foundation

Foundation

The Psychohistorians

Users

Hari Seldon

      It seems that all of the page content must be wrapped inside that element near the end - **which is all wrapped up inside the "off-canvas-wrap"**. If this is so, how does the modular nature of wordpress code work? The entire page would need to be in the header.php, with no modularity. I feel I must be missing something. Really hope someone can help. Best wishes, Andrew.


Trying to map a PURL like url to a page

I'm trying to map a path such as               /BigOffer12345      to an actual page such that the numeric part is passed as an argument.               /Offers/BigOffer/?id=12345      The id passed in will ultimately be used to generate custom content pulled from a remote source (similar to a purl service). I've been looking into Rewrite, but I'm new to WordPress and I think I'm getting stuck on some basics. Does something like this need to happen in a plugin or is there another interface to get this into WordPress?


Search for featured image, then for first image, then for video thumbnail

I want wordpress to use featured image to create thumbnail. If there is not, then first image of the post. If not, video thumbnail. Can anyone help me modifying the code? Thanks in advance.               USED CODE     function get_attachment_id_from_src( $image_src ) {     global $wpdb;     $query = "SELECT ID FROM {$wpdb->posts} WHERE guid='$image_src'";     $id = $wpdb->get_var($query);     return $id;     }          add_filter( 'post_thumbnail_html', 'my_post_image_html', 10, 5 );          function my_post_image_html( $html, $post_id, $post_thumbnail_id, $size, $attr ) {     if( '' == $html ) {         global $post, $posts;         ob_start();         ob_end_clean();         $output = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $post->post_content, $matches);         $first_img = $matches [1] [0];         if ( empty( $first_img ) ){             $image_id = 129; // default image ID         }         else {             $image_id = get_attachment_id_from_src($first_img);         }         $html = wp_get_attachment_image( $image_id, $size, false, $attr );     }     return $html;     }


Wordpress 3.5 grab first image from gallery

I'm noticing that adding a gallery to a page now just lists the ID's of images, slightly different to before, and reordering the images just amends the order of the ID's listed in the gallery short-code. So this...               [gallery order="DESC" link="file" columns="4"]      It's now this...               [gallery ids="3439,3440,3444,3443,3445,3453,3457,3458,3456,3461,3452,3468,3467,3470,3464,3459,3463,3462,3460,3466,3454,3450,3449,3448,3451,3447,3446,3442,3441,3438,3471,3469"]      Which is fine, and old galleries created in previous versions still appear to work. My problem is I have a summary page grabbing the first image of every child page. The code is something like this....                                                                           $args = array(                                                                 'post_type' => 'attachment',                                                                 'post_parent' => $page->ID,                                                                 'orderby' => 'menu_order ID',                                                                 'order'=> 'asc',                                                                 'numberposts' => 1,                                                                 );                                                             $attachments = get_posts($args);      This now doesn't work (I'm guessing because gallery order is now based on the ID's) Any way to fix it? Thanks


What is the p parameter in a get_posts() parameter array?

I've seen code that looks like this: `get_posts(array('p' => $thumbnail_id, 'post_type' => 'attachment'));` What is the definition of the p parameter and is it documented anywhere? I can't find anything about it on the Codex page for get_posts().


Add Google+ Badge to Posts - Specific to Author

I want to add a Google+ author badge to the posts/reviews on my website. This would normally be a simple integration of the code that Google provides: https://developers.google.com/+/web/badge/ However, we have multiple authors so I need to pull out the relevant Google+ link from the admin, depending on who the author of the post is. The URl is currently stored under the "Google Profile URL" field in any user's WP user profile. This is not a default field, but I have used a Google+ plugin that lets you store a user's Google+ profile address as part of their Wordpress user profile. This is the plugin: http://helpforwp.com/plugins/google-author-link/ The main feature that I'll be using from the plugin is how it inserts a new field into user profile information in Wordpress - it's this field that I want to pull information from. Can anyone help me do this? Thanks.


Selecting related posts

I am displaying related posts with the below code:

You may also be interested in...

     <?php     $posts = get_posts('numberposts=4&orderby=rand&category='. $category->term_id      . '&exclude=' . $current_post);     foreach($posts as $post) :     $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ));     ?>
<a href="<?php the_permalink(); ?>"><?php the_title(); ?>
<img          src="<?php echo esc_url( $image[0] ); ?>" alt="View more info" />
     <?php endforeach; ?><?php endforeach; ?>

       ...but I want to make sure it displays posts even if no others in the same catagory...so something like               if (less than 4 related posts) {          display any other posts from other catagories     }      Thanks for your help.


Calling custom profile fields?

I've hidden and created various profile fields using the following code:               function my_user_contactmethods($user_contactmethods) {          // You can get rid of ones you don't want     unset($user_contactmethods['jabber']);     unset($user_contactmethods['yim']);     unset($user_contactmethods['aim']);     unset($user_contactmethods['googleplus']);     unset($user_contactmethods['url']);     unset($user_contactmethods['twitter']);          // And add any news ones. The array key is the meta key name, the text     // is however you want it labelled -- keep the key name the same as you have in gf map.          $user_contactmethods['I work for...'] = __('I work for...');          // etc for each field you want to appear          return $user_contactmethods;          }          add_filter( 'user_contactmethods', 'my_user_contactmethods');      I'm then trying to call the custom field using the following:               <?php echo get_user_meta($current_user->ID,'I work for...',true);?>      This doesn't show anything, can someone point me in the right direction?


Manipulating Media uploader

Ok. Going to try and explain this as best as I can, so bare with me. Anyway, I'm trying to include the default media uploader as a part of my plugin. Currently, I've successfully managed to use the filter `attachment_fields_to_edit` to hide most of the input fields, leaving only the title & alternate text fields, alongside a custom submit button. When clicked, this button gets the images URL and places it into a `div` on the parent page. Anyway, so here is my problem. Everything regarding the uploader itself is functioning how I want it to, but currently the filter is applying itself to the media uploader in posts, pages, the media library, etc. I only want the alternative fields & custom button to show within my plugin, but not elsewhere. I've tried everything, but I cannot get it to work. I managed to apply my own query to the media-upload.php URL, and that way I could make the alternative fields only show within my plugin on the thickbox 'library' tab, but when uploading a new image the default fields were showing because Wordpress uses an alternative file to upload the image; async-upload.php. Here is the entire function: http://pastebin.com/5vpecMvL Just some information on the various functions: `riva_slider_pro_info()` is a function that returns an array of values. `riva_slider_pro_uri( $search )` gets $_SERVER[ 'REQUEST_URI' ] and stores it in a variable, search its for the $search parameter and return true or false. In the 'libary' tab within the media uploader thickbox, it is returning `true` because I have passed a additional query onto the media-upload.php URL (for example, 'media-upload.php?post_id=0$slideshow=true&type=image&TB_iframe=1'). BUT, it is returning `false` after the user has just uploaded a new image within the same thickbox, because it uses the async-upload.php file instead. Not sure how I could pass the query onto this URL, if it would be possible to make it work that way. I realise this may be hard to follow, but I've tried my best to explain it. I'm literally pulling my hair out over this one and spent a ridiculous amount of time trying to figure it out. Appreciate any comments or suggestions, or ideally a solution! Thanks in advance.


Author Link Not Displaying

I have used this with "echo" as its outside the loop i believe to the author of the post as a link, however its not displaying as a link?
Random Posts By You

     <?php     $args = array( 'numberposts' => 5, 'orderby' => 'date' );     $rand_posts = get_posts( $args );     foreach( $rand_posts as $post ) : ?>
<a href="<?php the_permalink(); ?>"><?php the_title(); ?>
     Written by:      <?php echo the_author_link(); ?>     <?php endforeach; ?>      Can someone advise?


show_option_none not working in meta box

I have the following code going into a meta box:               function multi_author($post, $box)     {     $currentAuthors = esc_attr(get_post_meta($post->ID, 'multiAuthors', true));     if ($currentAuthors) {         $authors = explode(',', $currentAuthors);     }     $y = 1;     for ($x = 0; $x <= 3; $x++) {         $output .= "Author #{$y}: " . wp_dropdown_users(array(                     'show_option_none' => '-- Select --',                     'echo' => 0,                     'name' => 'author' . $y,                     'selected' => $authors[$x],                     'who' => 'authors'                 )) . "<br/>";         $y++;     }          echo $output;     }      If I place this code into a front end facing page, everything works as expected. When this code is in a meta box, the 'show_option_none' tag is ignored and everything else works as planned. Wordpress version 3.1.3 is being used. Any guesses as to why this is happening?


retrieve post slug by post_tags taxonomy

My scenario: I have a part of a site which retrieves all post_tags terms for a specific category the code:                               query_posts('category_name='. $category[0]->cat_name);                     if (have_posts()) : while (have_posts()) : the_post();                         $posttags = get_the_tags();                         if ($posttags) {                             foreach($posttags as $tag) {                                 $all_tags_arr[] = $tag -> name;                              }                         }                     endwhile; endif;                                $tags_arr = array_unique($all_tags_arr);                           foreach ($tags_arr as $cat_by_tag) {                         $output_promotion .= '
cat_name . '/' . ????? . '/">'. $cat_by_tag .'
';                     }                          echo $output_promotion;      This all works fine, the code retrieves all post_tags and removes duplicates. I'm stuck now with the post slug. What I want is: retrieve post slug by post_tag term. Example: Post title: ABC Post post slug: abc-post Tag in that post: ABC Tag I need something like this:               ABC Tag      Anyone can help? Thanks in advance!


qTranslate get content by language

How do you get the content by id and by specific language? I need to display two specific language content in a page, regardless of the session's language. So far, this is my progress: this works fine for getting the content by id of the active language:               <?php $id=47; $post = get_page($id); $content = apply_filters('the_content', $post->post_content); echo $content;  ?>      How to apply a specific language to the filter? Thanks for the help. Sziro


How do I list the next 7 days and any events (cpt) contained in those days

I need to list the next seven days no matter what day it is. If its monday, it starts with today and lists 7 days, if its friday it starts with today and lists 7 days from today. Next I need to show any events for that day. IF there are no events for a given day it simply lists a default graphic. I am going to make a featured event for a each day and eventually set it up so that it just shows that one but for now I just want to list the next 7 days and any events contained within them. I have two piece that don't fit together very well. First:               <?php $cur_day = 'current_day'; $last = 'last';     $date = date('o-m-d'); $ts = strtotime($date); $dow = date('w', $ts);      for ($i=0; $i<7; $i++, $ts+=86400){ ?>      This will list each of the next 7 days starting with today.                $event_query = new WP_Query(             array(                'post_type'   => 'event',        // only query events               'meta_key'    => 'event-date',  // load up the event_date meta               'orderby'     => 'meta_value',               'order'       => 'asc',         // ascending, so earlier events first               'meta_query'  => array(                  array(         // restrict posts based on meta values                   'key'     => 'event-date',  // which meta to query                   'value'   => $event_date,  // value for comparison                   'compare' => '=',          // method of comparison                   'type'    => 'NUMERIC'         // datatype, we don't want to compare the string values                 ) // meta_query is an array of query ites                ) // end meta_query array               ) // end array             ); // close WP_Query constructor call      This lists the next seven days but doesn't do well with the events... I am looking to duplicate this: http://www3.dmagazine.com/events with cpt's thanks PLEASE HELP


Display all custom post type posts and order them by an optional meta_key

I have a custom post type (CPT) called `property`. I have registered a featured property `metabox`for it as explained in this question "How do I create a featured post within a custom post type?". So a featured property has got `meta_key='property_featured'` and `meta_value=on`. What I would like to do is to display **all** `property` posts, but order them by `meta_key='property_featured'`. So that featured properties will appear first in the list on the first page. Similar behavior as `Sticky Posts` functionality. And all the rest `property` posts will be ordered by date created. Also, I need to make sure that pagination is working correctly - treating all the `property` posts alltogether. I use custom pagination code explained here. (Hope that makes sense). I have tried to specify arguments for WP_Query. However, if I specify:               'meta_key' => 'property_featured',     'orderby' => 'meta_value'      then **only** `property` posts with that key are displayed as opposite to **all** `property` posts. If I delete `meta_key` from arguments then the query doesn't know what to sort them by.   How do I display all the `property` posts, making sure that `featured` ones appear first and all other `property` posts order by published date? Many thanks, Dasha


Modernizr and WordPress - How can I add a CSS class to the html element?

The instructions for implementing Modernizr state that I should add `class="no-js"` to the `<html>` element. Is there a way to do this in WordPress using a hook or filter? If at all possible, I'd prefer to do this without editing the theme files.


How to show total view count across all posts for an author

I'm using wp-postviews to track views for posts by authors on my site. It stores the view count in the post meta field `$views`. I'd want to show on their profile a total count of views for all their posts combined. How to do that?


BLOG_ID_CURRENT_SITE vs. SITE_ID_CURRENT_SITE in WordPress Multisite?

I've been trying to figure out why we have the constants `BLOG_ID_CURRENT_SITE` and `SITE_ID_CURRENT_SITE` _(vs. hardcoding them to be equal to`1`)_, what exactly the differences are, and when either of them will not equal 1? Any insight will be appreciated. Thanks in advance.


Loading Javascript Only When Specific Content Existing in a Post?

I'm trying to add Javascript for my _"PrettyPhoto"_ plugin to pages only when their content contains `rel='prettyPhoto'`. This looks very simple to me but all solutions I've found on the internet doesn't work for me. One example is:               <?php     function load_my_js() {       if(is_admin() ) return; // never mind if this is an admin page       global $post;       if (strpos($post->post_content,'rel="prettyPhoto') == false) return       wp_register_script('js_test',plugins_url().'/demo/test.js',array('jquery'));       wp_enqueue_script('js_test');     }     add_action('wp','load_my_js');     ?>      Another one from Yoast:               function yst_conditional_thickbox() {       global $post;       if (is_singular() &&         strpos($post->post_content,'class="thickbox"') !== false) {           wp_enqueue_script('thickbox');           wp_enqueue_style('thickbox');       }     }     add_action('wp_print_styles','yst_conditional_thickbox');      Maybe you know how to do this? Thank you! * * * **UPDATE** This is how looks your code:               class UglyPhotoPlugin {       static function on_load() {         add_action('wp',array(__CLASS__,'load_my_js'));       }       static function load_my_js() {         if (!is_admin()) {           global $post;           if (strpos($post->post_content,'rel="prettyPhoto"') !== false) {             wp_enqueue_script( 'jquery' );             wp_enqueue_script( 'prettyJs', get_bloginfo('template_directory').'/js/jquery.prettyPhoto.js', array( 'jquery' ) );           }         }       }     }     UglyPhotoPlugin::on_load();      HTML output:               We are here!stdClass Object     (         [ID] => 17         [post_author] => 1         [post_date] => 2009-12-25 17:10:18         [post_date_gmt] => 2009-12-25 17:10:18         [post_content] =>          [post_title] => Portfolio         [post_excerpt] =>          [post_status] => publish         [comment_status] => closed         [ping_status] => closed         [post_password] =>          [post_name] => portfolio         [to_ping] =>          [pinged] =>          [post_modified] => 2010-12-21 00:24:59         [post_modified_gmt] => 2010-12-21 00:24:59         [post_content_filtered] =>          [post_parent] => 0         [guid] => http://mysite.com/?page_id=17         [menu_order] => 3         [post_type] => page         [post_mime_type] =>          [comment_count] => 0         [ancestors] => Array             (             )              [filter] => raw     )      This code is generated above `!DOCTYPE`. Am I right?


How to remove the Navigation Bar (prim. and sec.) from the Homepage for the Genesis Framework?


Number of displayed posts

I have tried many things to solve this problem. So I have a plugin which displays projects assigned to users in a widget. It displays projects as posts. The problem is that it only displays `5` projects on the page. I am sending a code which display posts:               $projects = get_posts(array('post_type' => 'projects'));      One guy told me to change it to               $projects = get_posts(array('post_type' => 'projects', 'number posts' => 10));      which should help but it didnt. Anyone have idea how to solve it ? I can send whole code if it's needed.


Imagem resolution responsive

I have a `add_image_size` to resize an image, but when i have 980px of resolution, the image still the same size. I would like the image be 100% when the resolution is lower than 980px, but I need to continue using the code `add_thumbnail_size`. Thank you!


wordpress json custom taxonomy problem

I created 1 custom post type with 2 custom taxonomy. Installed http://wordpress.org/extend/plugins/json-api/ and tried to reach result with: http://example.com/api/get_recent_posts?dev=1&post_type=myposttype well it gives me custom posts but not giving those post's custom taxonomies "categories": [], "tags": [], How can i query custom taxonomies with json api? Actually i am trying to create a simple iphone app with jquery mobile + phonegap. Maybe you know a better way then json api?


videos not showing on my tag pages

i am using the Smart Youtube plugin for wordpress to show youtube videos. This works fine on my main site. But when i click on a view by a certain tags, none of the video show up in the blog entries. so when i view: **http://mysite.com** it works fine and when i view an individual post like: **http://mysite.com/?p=3580** , it works fine but when i view **http://mysite.com/?tag=video** it only shows the blog entry heading (and not the video). if i click into the post it shows it fine on the individual page. Is there anyway to see videos on a page by tags?


Display all posts from selected category

This is going to be tough to explain. I have created a custom theme and have a file called: categories.php, in this file i have:                   <?php             $args = array('hide_empty' => FALSE);             wp_list_categories($args);         ?>      This displays all my categories as links, even the ones without a post associated with them. My permalink structure is this /%category%/%postname%/ so when i click a category name i go to http://example.com/category/action/. This is fine but what i'm struggling with is what file i have to create and what i have to put in said file so it displays all the posts from the clicked category? Thanks


Is there a way to make the main page only display a brief description of the full article?

I want to make a new blog which only has a brief description of the article on the main page, instead of a shortened version of it. I want to make the brief description of the article myself. Is there any way to do this, or any plugin which allows it?


Set of plugins to control the Admin UI

What plugin you would recommend that would give powerful Admin UI options such as change Add Posts menu item to Add Articles, remove Add Media option for certain user roles and not allowing certain user roles to create Tags etc. I'm not talking about those plugins that lets you do client logo instead of Wordpress logo and stuff. I'm talking about some real hard core admin functionality customization. Is there one out there that excells in this regard?


Listing post with this way "domain.com/taxonomy/category

I am triying to modify wordpress (version 3.3) for that the listing to be able to show posts from one taxomy and one category. I have installed two plugin: WP No Category Base WP No Taxonomy Base These allow me to show post with this kind of url: domain[.]com/taxonomy-1 and domain[.]com/category-1 At this poing I am triying to get the results with domain[.]com/taxonomy-1/category-1 ¿Which is the function about this?


How to combine jQuery in-place editor with $wpdb->update

i am trying to use jQuery in-place editor (http://code.google.com/p/jquery-in- place-editor/) on WordPress to update certain values of a custom made table in my database. I am not really skilled with AJAX (first time trying to use it) or MYSQL, that's why I am having difficulties. I will try to explain my problem in the best way possible. What I want is to change the value of the **column** (telephone) inside the **table** (wp_esn_cardholder). Each row has an unique **ID** (id_cardholder). I can smoothly run the jQuery in-place js inside the page, calling for "save.php"               <script type="text/javascript" charset="utf-8">       $(document).ready(function() {         $(".editable").editInPlace({           url: "http://example.com/save.php",         });       });     </script>      With save.php I try to update the value, using the following code               <?php     global $wpdb;           $update_value = $_POST['update_value'];     $element_id = $_POST['element_id'];     $original = $_POST['original_html'];          $table = 'esn_cardholder';     $row_id = $_POST['element_id'];          $data_array = array('telephone' => $_POST['update_value']);     $where_array = array('id_cardholder' => $row_id);     $wpdb->update( $wpdb->prefix . $table, $data_array, $where_array )     ?>       Using Firebug's console, I can see that the following passes through:               Parameters application/x-www-form-urlencoded     element_id  278     original_html   old-number     original_value  old-number     update_value    new-number          Source update_value=new-number&element_id=278&original_html=old-number&original_value=old-number      The thing won't update the database, and I obviously don't know why. I know that I should sanitize the query but I can think about that once it works :). Thanks in advance


Issue with get_theme_mod returning a blank value instead of the saved value

I have what seems to be a rather troubling issue with the get_theme_mod function in the latest version of Wordpress. Only on particular servers (of which meet all Wordpress requirements) the function won't return the saved value that I can see stored in the database. However if I specify a default value for the function, it will always return the default value from the second argument. I am really at a loss here because the servers are all running PHP 5.3 and more than required MySQL versions. All environments are PHP and Apache with nothing in-front or in-between. This doesn't seem to be a consistent error, it's only on particular servers this seems to be happening. I am utilising the Wordpress Theme Customization API in my project and on the offending servers have noticed the following things:   * When making changes in the Theme Customization API preview pane, they are reflected. However, navigating to a different part of the site in the preview pane (clicking a link or whatnot) and it'll revert back to its default value. Hitting refresh also sets everything back to its default values.   * Inspection of the AJAX request via Chrome Developer Tools "Network" tab shows the data is correctly being sent and the server is sending back a response code of 200 insinuating everything is fine.   * Inspecting the appropriate database table row that stores the serialized data that has been saved shows that it is in-fact being saved correctly, but when using the get_theme_mod() function it is not returned.   * I tried dumping the contents out from the function "Get_theme_mods()" to see what it would return and I get nothing (absolutely nothing is returned). Doing this on a working server however returns the appropriate contents.   * All Theme Customization API values are defined as per the documentation suggests and I have even tried setting the setting type to, "theme_mod" to no avail (even though theme_mod is the default anyway).   * When trying to call the get_theme_mod() if I add a set_theme_mod before the function call and set a value manually myself, it saves and the get_theme_mod function gets the value saved just before it. This means that changes appear to be acting like they're only temporarily being saved (even though the DB says otherwise). I also have no plugins installed or activated that could be overwriting any of the theme options or preventing them from being returned. My only conclusion is that it relates to some kind of web host level caching (APC perhaps) or perhaps Wordpress itself caching the options (I presume get_theme_mod) is cached much like the get_option function is elsewhere. If you require any code, just let me know what you require (as I am not sure). _**_Edit **** I did a var_dump on the contents of the get_theme_mod functions being called and got the following (did it for quite a few, not all of them). The labels in front with the colon are for showing what value is what.               Texture: string(4) "none"      Background Color: string(0) ""      Theme Color: string(7) "#FF0000"      Body Font: string(0) ""      Heading Font: string(0) ""       Out of frustration I tried the following code as well and nothing is returned:               $options = get_option("theme_mods_aphrodite");          var_dump($options);      The result I get from this is bool(false). Another thing I tried was using the default Twenty Twelve theme customizer and it worked, so something somewhere in my theme is destroying the options row and preventing it from working. But what makes that strange is that the theme I am having issues with works mostly fine on other servers I try, it's only particular isolated incidents and the database table is in-tact. **Edit #2 **** As suggested below I pasted in my theme customisation code into another theme (I picked Twenty Twelve because it works out of the box) and it appears my register code breaks the customiser and I can't work out why.


Issue plugin commands in admin settings page

What is the right way to issue commands in wp-admin? My plugin imports data from a set of RSS feeds via a cron job. Thats all working good. I've set up a custom settings page to change parameters, and wanted to add an "Update Now" button so the user could force a manual refresh. I need a few other commands as well. What is the "wordpress way" to add and handle these commands? I tried adding a url http://example.com/wp-admin/options- general.php?page=myplugin&action=update to the options page, then               if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'update') { doUpdate(); }      but i get an error showing $wp has not been initialised. I tried including the wp-load.php and the wp-settings.php but it didn't help. Error message is `Fatal error: Call to a member function add_rewrite_tag() on a non-object in /wordpress/wp-includes/rewrite.php on line 51` The lines causing the problem in doUpdate() are                   if (taxonomy_exists($name)) {             return;         }              $slug  = str_replace(' ', '_', $title);         register_taxonomy(             $name,             '',             array(                  'labels'            => array( 'name' => __(ucwords($title)) ),                  'public'            => true,                  'show_ui'           => self::SHOW_UI,                  'show_in_nav_menus' => true,                  'show_admin_column' => true,                  'hierarchical'      => false,                  'query_var'         => $slug,                  'rewrite'           => array( 'slug' => __($slug) ),             )         );      What am I doing wrong? How can I allow the user to perform an action from an admin settings pane?


Creating nested forum loops in bbPress

I'm creating a customised forums front page for bbPress, by listing forums in a different way to the bbPress default. Essentially what I'm trying to do is replace the use of bbp_list_forums() with a second, nested bbPress loop so that I have greater control over how the sub- forums are displayed. I know I can use the 'before' and 'after' parameters of bbp_list_forums() but that doesn't give me as much control as I need. The only question I found that came close was this one which doesn't actually provide a definitive answer. My code so far is like so;               <?php while ( bbp_forums() ) : bbp_the_forum(); ?>

<?php bbp_forum_title(); ?>

<?php _e( 'Latest post', 'youngsibs' ); ?>

<?php _e( 'Threads', 'youngsibs' ); ?>

<?php bbp_show_lead_topic() ? _e( 'Replies', 'bbpress' ) : _e( 'Posts', 'bbpress' ); ?>

                  <?php                 bbp_list_forums(array(                     'before' => '
',                     'after' => '
',                     'link_before' => '
',                     'link_after' => '
',                     'count_before' => '
',                     'count_after' => '
',                     'count_sep' => '

',                     'separator' => '

',                     'forum_id' => '',                     'show_topic_count' => true,                     'show_reply_count' => true                 ));             ?>

          <?php endwhile; ?>      See the bbp_list_forums() reference - in place of that I want another "while (bbp_forums())..." loop but how do I do that without interfering with the main loop?


wp_update_post call really slow when official Facebook plugin is installed

I'm having this weird issue, if i install my plugin and the official Facebook plugin the call to wp_update_post() becomes really slow. I've done some benchmark and it goes up to almost two seconds. If i disable Facebook plugins it reverts back to normal. Anyone knows what should i do to avoid this?


using query_posts to pull posts out of a category in a while loop. Getting odd echo

I have a custom template file I've been workin on. I have this code performing a loop after it queries posts from a certain category. This works and I have each post configured with styled divs, but for some reason, on the side of the page, I have strange numbers being displayed. I don't understand where they are coming from. The most posts in a category, the more numbers. Example #'s on page: 65138 I believe the 138 is the post ID of one of the posts being called in my while loop. I'm not sure what the 65 means. Am I using a function that is echoing these values for some reason and I don't know it??               <?php      // Select the category to get posts from.     $posts_of_interest = query_posts('cat=5');     $num_of_posts = count($posts_of_interest);     if(have_posts()) :     while( $i <= $num_of_posts):         $i++;         $queried_post = get_post(the_ID());         echo $queried_post->post_content;            the_post();     endwhile;     endif;     wp_reset_query();     ?>        Thanks!


Filter to strip unnecessary attributes

I'm looking for a concise PHP filter to add to my functions.php that will search for and strip the following attributes I don't want in my HTML:   * rel="attachment"   * rel="attachment wp-att-{x}"   * rel="category"   * rel="category tag"   * rel="bookmark"   * rel="author"   * pubdate I'm happy for all "rel" attributes to be stripped (rather than just what's listed above) if that's easier.


Ordering by 'Title' OR 'Custom Field'

I have an issue here that I just can't wrap my head around. Let me jump right into it: Basically I have a site that has 4 order options; -Name Ascending -Name Descending -Price Ascending -Price Descending Getting it to order by "title" was easy enough after I fixed some issues. Basically just did this..               <?php         $order = isset($_GET['order']) ? $_GET['order'] : "ASC";         $sort_by_title = isset($_GET['sort']) ? $_GET['sort'] : "title";     ?>      Then               <?php         $args["orderby"] = $sort_by_title;         $args["order"] = $order;     ?>      And finally               Name Ascending     Name Descending      Now the price field is a custom field, and it's easy enough to sort by price if I replaced               $args["orderby"] = $sort_by_title;      With               $args["orderby"] = $custom_field_name;      It'll sort it by price and there's no issue there. The issue is figuring out how to figure out what the user clicks and determining what it should now be ordered by. If needed, my full $args is               $args = array('post_type' => 'model-pricing', 'posts_per_page' => 5, 'meta_key' => 'Community', 'meta_value' => $community_choice, 'paged' => $paged);         $args["orderby"] = $sort_by_title;         $args["order"] = $order;      I'd really appreciate some help with this one guys, even some insightful thoughts on how I might tackle this issue. Thanks!


Canonical Resource URLs Across a Multisite Network 2012?

This question was asked back in 2010 @ Outputting Canonical Resource URLs Across a Multisite Network? WordPress MU Domain Mapping @ Wordpress.org Since many things have changed since then, I was wondering what would be the best method to do this now. Would it be easier/better to just use .htaccess rules or in a varnish VCL? I want to normalize plugin/theme files accross all of the sites on the network without using any host file hacks and works with the domain mapping plugin. I am using the subdirectory install and also a CDN. Thank you for any help/examples. This is my first post, but long time lurker ;) P.S. If themes/plugins would need to be manually edited, would it be easier to create a plugin with all of the rules that can be network activated?


Functions file mods and CPU

Will adding code similar to what I've pasted below to the functions.php theme file slow down a Wordpress site or effect CPU? (Thank You)               function remove_menu_items() {       global $menu;       $restricted = array(__('Links'), __('Comments'), __('Media'),       __('Plugins'), __('Tools'), __('Users'));       end ($menu);       while (prev($menu)){         $value = explode(' ',$menu[key($menu)][0]);         if(in_array($value[0] != NULL?$value[0]:"" , $restricted)){           unset($menu[key($menu)]);}         }       }


Plugin link does not appear in my toolbar

I haven't installed anything that would break the link, as far as I can tell it's just never been there. I have no idea what to do, please help.


Content/Excerpt length control for a specific loop?

Is it possible to control the length of the content or excerpt for a specific query/loop? I have come across the following code, but this changes the length for all excerpts, I want it focused on a specific custom query.                   add_filter('excerpt_length', 'my_excerpt_length');     function my_excerpt_length($length) {     return 20; }


Including template pages within another template?

I've created a vertical page template which displays stacked sections (which are simply the content from other wordpress pages). I am having problems displaying the contents of pages which are themselves using templates. This is the main query I am using to fetch the contents of other pages:               <?php     //change to the title of the pages you want to feature     $page = get_page_by_title( 'About' );     $page_data = get_page($page);          // Displays the content     echo apply_filters('the_content', $page_data->post_content);     ?>      This works fine for most of the pages, except those which rely on templates themselves. I "think" I need to include something about "get template part", but I am not experienced enough to understand how to use in this situation and could use some help? Thanks


Using the on-board image editor for featured images: edits are not being used

I've never really been comfortable with the on-board image editor in WordPress, and here's a good example of why: I'm just setting up a vanilla WP installation and am using the TwentyTen theme. I've uploaded an image, rotated it 90 degrees (using the Edit Image feature), saved it and have used it as my Featured Image. The image that appears in my header and featured image area is still the original, rotated version. When I go back to the Gallery for this page, by clicking on the Featured Image in the Edit Posts section, the image is rotated correctly. But back on the Edit Posts section, or on the actual site the image is not rotated. I've hit "Save all changes" a dozen times, I've switched sizes a few times, and I'm using "Apply changes to: All image sizes" in the Edit box. I'm running out of options. Can someone walk me through the correct process to upload, rotate, and set a featured image? thanks!


How include comment and post count of user in this custom query

This is a listing of members with pagination               <?php     $total = "SELECT ID, user_nicename from $wpdb->users ORDER BY user_nicename DESC";          $totalposts = $wpdb->get_results($total, OBJECT);          $ppp = intval(get_query_var('posts_per_page'));          $wp_query->found_posts = count($totalposts);          $wp_query->max_num_pages = ceil($wp_query->found_posts / $ppp);          $on_page = intval(get_query_var('paged'));          if($on_page == 0){ $on_page = 1; }          $offset = ($on_page-1) * $ppp;          $wp_query->request = "SELECT ID, user_nicename from $wpdb->users ORDER BY user_nicename DESC LIMIT $ppp OFFSET $offset";          $pageposts = $wpdb->get_results($wp_query->request, OBJECT);     ?>          <?php if ($pageposts):     shuffle($pageposts);     array_rand($pageposts); ?>          <?php foreach ($pageposts as $author):     // Get user data     $curauth = get_userdata($author->ID);     // Get link to author page     $user_link = get_author_posts_url($curauth->ID);     // Set default avatar (values = default, wavatar, identicon, monsterid)     $avatar = 'wavatar';     ?>          <?php setup_postdata($post); ?>       If I can include avatar, I think I can show post count and comment count too.


Displaying info in a sidebar

Hi I run a site gaming review site www.co-opreviews.com. I'm trying to display info about the games in a sidebar on the right hand side of the page. (You can view a mockup of the sidebar here: http://i.stack.imgur.com/u3s5b.png) I'm currently doing this through multiple sidebars (which my theme allows) and using a plaintext widget displaying the info through some rough HTML. However for 50+ games I'd require 50+ different sidebars and I'd have to replace the date, rating etc. all manually-- a cubersome and also fairly crude solution. I believe there is a way to make inserting the information easier with custom post types but all my current reviews are simply normal posts. Any help with my problem would be appreciated!


How to change font in title of sidebar widget

I'm not sure if this question belongs in the CSS forum or the WordPress forum... At this link to my wordpress site: http://richardclunan.com/ in the sidebar, there's a title for a widget "GET FREE CHAPTERS PLUS MORE HELPFUL COPYWRITING IDEAS" - I'd like to change the font of widget titles, so it's not all-caps. So it's small and bold. How do I do that? I'm a novice. Where would do i go to find the right file; what's the file name; what code do i need to find to change; and what code do i use as the change?


how to make URL link query string

I have pages with a custom meta field called "ctr_state", and it contains a state name, like "Arizona". I am trying to construct a hyperlink that will return an archive-like list of pages that match the meta_value I am looking for. For instance,               Show All Arizona Pages      This isn't working, but is just to show how I want it to work as a link. I don't want a list on the page, I just want it to link to an archive type page, showing just the page's that match the state I'm looking for. Is this possible?


How to Query Updated Post in WordPress

I have seen some website which are showing the updated post. How can I query updated post from database. please help me thank's


Make parent page only link to first subpage

I'd like to automatically make any parent page link to it's first subpage if it has one. Like so:   * Parent 1 (/#subpage-1)      * Subpage 1 (/#subpage-1)     * Subpage 2 (/#subpage-2)     * Subpage 3 (/#subpage-3)   * Parent 2 (/parent-2)   * Parent 3 (/parent-3) I found some code that finds all the parent links through a complicated nav() walker. From here I'm not sure how to find the first childs url. I assumed it would be `$children_elements[0]->url` but it doesn't seem to be the case.               class Themeslug_Page_Navigation_Walker extends Walker_Nav_Menu {         function display_element( $element, &$children_elements, $max_depth, $depth=0, $args, &$output ) {             $id_field = $this->db_fields['id'];             if ( !empty( $children_elements[ $element->$id_field ] ) ) {                 $element->url = "Where do I get the child URL?";             }             Walker_Nav_Menu::display_element( $element, $children_elements, $max_depth, $depth, $args, $output );         }     }


Rename attachment filenames to attachment ID on upload

I have been trying this code out (based on this Change attachment filename ), it does not work properly. For instance, featured image is not being displayed in admin panel single post, neither are being created and uploaded all WordPress re-scaled sizes (as in media settings). Could someone try this out in order to confirm (me using latest WP version) or could someone give a fix ? Thank you !               add_action('add_attachment', 'rename_attacment');     function rename_attacment($post_ID){              $post = get_post($post_ID);         $file = get_attached_file($post_ID);         $path = pathinfo($file);             //dirname   = File Path             //basename  = Filename.Extension             //extension = Extension             //filename  = Filename              $newfilename = "{$post_ID}";         $newfile = $path['dirname']."/".$newfilename.".".$path['extension'];              rename($file, $newfile);             update_attached_file( $post_ID, $newfile );          }


Auto activate plugin with unique user settings

I know its possible to auto install/activate plugins (on theme activation) via something like http://tgmpluginactivation.com/ What I want to know is if its possible to activate plugins **and** auto-setup their unique preferences? For example, its possible to auto install the All in One SEO Pack plugin using the code above. Is it also possible to have the plugin settings changed from disabled (default) to enabled - so it actually starts working right out of the box?


What is wrong with this pagination code?

I'm trying a new approach to paginate posts returned in a category.php file. I want to see snippets of 10 posts at a time. Filename is category-xyz.php and this worked before I changed to this method, although I was using showposts=200 and it was returning all 180 posts in that category. I changed method because several calls I used were deprecated (eg showposts) or not advised. I am using this post's solution for reference: How to fix pagination for custom loops? Here's my code:               <?php     // Define custom query parameters     $custom_query_args = array(      'cat' => 76,      'posts_per_page' => 5     );          // Get current page and append to custom query parameters array     $custom_query_args['paged'] = get_query_var( 'paged' ) ? get_query_var( 'paged' ) : 1;          // Instantiate custom query     $custom_query = new WP_Query( $custom_query_args );          // Pagination fix     $temp_query = $wp_query;     $wp_query   = NULL;     $wp_query   = $custom_query;                  // Output custom query loop rather than use wp_query             if ( $custom_query->have_posts() ) :                   while ( $custom_query->have_posts() ) :                    $custom_query->the_post();             // Loop output goes here             ?>
                 <a href="<?php the_permalink() ?>" rel="bookmark"><img src="<?php echo pcrmbimagegrab() ?>" alt="<?php the_title(); ?>" />

<a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?>
             <?php the_content_limit(190, ""); ?>                                     <?php $customField = get_post_custom_values("price");                       if (isset($customField[0])) {                       echo "Price: ".$customField[0];                      echo "   ";                     } else {                      ;                     }                     ?>                       <?php $customField = get_post_custom_values("sku");                       if (isset($customField[0])) {                       echo "|   Stock Reference: ".$customField[0] . "   ";                     } else {                      ;                     }                     ?>                   <a class="postbutton" href="<?php the_permalink() ?>" rel="bookmark">View

                            <?php              endwhile;     endif;     // Reset postdata     wp_reset_postdata();          // Custom query loop pagination     previous_posts_link( 'Older Posts' );     next_posts_link( 'Newer Posts', $custom_query->max_num_pages );          // Reset main query object     $wp_query = NULL;     $wp_query = $temp_query;          ?>      I have also tried this because I am not sure which parameters I need in the custom query array:               // Define custom query parameters     $custom_query_args = array(      'cat' => 76,      'posts_per_page' => 5,     'max_num_pages' => 20,     'paged' => $paged,     );      The pagination link goes to /category/category-name/page/2/ which results in a 404 error. Any ideas why?


Images not being generated at correct size

I have my WordPress Media settings set like so. Based on these settings no generated large image should exceed the width of 540px. I embed an image in a post like so. I choose "Large" as a image size, which should have a restricted width of 540px. The end result is an image of 1024x769px. Why won't the image adhere to my Media settings?


How can I get the sidebar id on the current page? The question is simple. I have looked at is_active_sidebar(), is_dynamic_sidebar() but they don't provide the info that I need.


posts_nav_link on single.php

The situation...I use 3 categories. One of them is called 'News'. This page shows on the left the latest post in the category 'News' and on the left it shows the 10 most recent posts from this same category. And there is the default navigation...« Previous Page — Next Page ». A single post from the 'News' category looks the same as the 'News' page. On the left is the post and on the right the 10 most recent posts. And the navigation... This is where the problem is. The navigation button links to:               ../news/single-post-title/page/2/      Where it should link to:               ../news/page/2/      Anyway to work around this problem? How to add next/prev page links to a single.php?


Can I search only some of the fields of a custom post type?

I want to create a custom post type with fields: Text1, text2 and text3. I want to make this custom post type searchable. But searchable fields will only be Text1, and text2. Is this possible? Thanks


How to use the xili-language plugin?

Does anyone have any useful resources on how to use the xili-language plugin? I did not find any complete documentation from their part. I only found their blog with some examples but it's not so easy to understand. I want to test xili-language to translate our site.


WP Knowledge Base Theme bug - Subcategories and Articles, Need to change WP_Query

I'm using the `WP Knowledge Base theme`, which is almost perfect for the project I'm on, but I discovered an unfortunate bug. On the home page, if you have both SubCategories and loose Articles under a single Category, it won't display the Articles along side the SubCategories. You can see in the following picture how on the left, a single article is displayed that category, but on the right, two subcategories are shown, when the top category should have two sub categories and an article ![SubCategories, no article](http://i.stack.imgur.com/H0gtz.png) The inside of the category on the right looks like the following picture. Notice that although there are 4 articles listed, only 3 are present under subcategories, and there is no fourth article. ![No fourth article](http://i.stack.imgur.com/CsZc7.png) I went through the code and found this section:
         <?php if ( ! empty( $sub_categories ) ) : ?>         <?php foreach ( $sub_categories as $scat ) : ?>         <?php $sterm_meta = get_option( 'ipt_kb_category_meta_' . $scat->term_id, array() ); ?>         <a href="<?php echo esc_url( get_term_link( $scat, 'category' ) ); ?>" class="list-group-item">             <?php echo $scat->count; ?>             <?php if ( isset( $sterm_meta['icon_class'] ) && '' != $sterm_meta['icon_class'] ) : ?>             <i class="glyphicon <?php echo esc_attr( $sterm_meta['icon_class'] ); ?>">             <?php else : ?>                          <?php endif; ?>             <?php echo $scat->name; ?>                      <?php endforeach; ?>         <?php else : ?>                   <?php $cat_posts = new WP_Query( array(         'posts_per_page' => get_option( 'posts_per_page', 5 ),         'cat' => $cat->term_id,         ) ); ?>         <?php if ( $cat_posts->have_posts() ) : ?>         <?php while ( $cat_posts->have_posts() ) : $cat_posts->the_post(); ?>             <?php get_template_part( 'category-templates/content', 'popular' ); ?>         <?php endwhile; ?>         <?php else : ?>             <?php get_template_part( 'category-templates/no-result' ); ?>         <?php endif; ?>         <?php wp_reset_query(); ?>         <?php endif; ?>
      This is the section that defines what populates that list. I changed the `else` statement of the initial `if` to an `endif` and took out the `endif` at the very end, now the SubCategories and Articles being displayed are no longer exclusive. But, it displays all the articles, that is all the leaves, alongside the SubCategories. I.e., it displays all the subcategories alongside the articles that are in those SubCategories. In order to fix this, I have to change the WP_Query, I think, so that it only returns articles in the current category and not the Subcategories. I'm looking at the documentation currently, but does anyone have any ideas for this? I'm not as familiar with this as I'd like to be. Edit: A working example of this theme can be found on their site Edit 2: Ok, I'm really not getting this query. Here is a closeup.               <?php $cat_posts = new WP_Query( array(       'posts_per_page' => get_option( 'posts_per_page', 5 ),       'cat' => $cat->term_id,       ) ); ?>      So `posts per page` gets the option that I set in WordPress. `'cat' => $cat->term_id` looks like the same one that is on the examples page. `$cat->term_id` returns the particular category number. Unfortunately, it's also returning all the articles in the subcategories that are in that category. Is there a way to change that so it only returns articles at that level and not levels below?


Query posts by taxonomy term name

I would love to get the list of posts by their custom taxonomy (=store) name. Here is what I have so far, but it is not working. Please help with the code. $mystorename is a variable holding the name of the store i want to query by. Any help will be appreciated. Thank you               $args = array(         'tax_query' => array(         array(             'taxonomy' => 'store',             'field' => 'name',             'terms' => $mystorename         )     )     );          $postslist = get_posts( $args );if(count($postslist) > 0){ ?>


Plugin and javascript placement

I am making a plugin. I already use wp_enqueue_script with my javascript files. When shortcode is executed I need to write some javascript code which will contain this piece of code:               jQuery(document).ready(function() {     ...     //inside my plugin will initiate      (I cannot pre enqueue this piece of code because of some dynamic variables inside!) My question in this: where do I place this code in wordpress? I can create a javascript file, place it in wp_content in appropriate folder and call wp_enqueue_script with the path to that file. Is there a better way and how? I dont want this piece of code running more than once (and thus initiating my plugin twice!) Thank you for the advices!


How to backup and restore configurations

I am in the process of transferring my WordPress blog to a new host. I've copied the blog files, used XML import/export to copy the contents, and the blog is now up and running. The missing piece is configuration. At the new blog, all the plugins are turned off, the widget are set to default and the plugin settings (e.g. Google Analytics code) are not set. **How do I transfer my configuration and plugin settings from my old blog?**


Visual Editor not working for user on multiple computers

We are running 3.9.1, and haven't updated any plugins or our theme since the user started seeing an issue with a particular page. If the user opened up the page, nothing showed in the visual editor, unless they selected content, etc. If the user clicked to switch the editor, they had a 'switchEditors is not defined' error. After searching for this JavaScript error, most people it either resolved on its own, an update fixed it, etc. What is stranger - anyone else could edit this page just fine. Also, no matter what machine this person used, it showed the same issue, but only for them. User tried 3 browsers on one computer, 2 on another, and 1 on yet another machine. Copying and pasting content from one page to another worked fine - so the content wasn't an issue (it appeared) either. How could something like this follow a users account, and not the browser?


Only display price when value exist

I got two price value,(WpForest_price) first price (WpForest_price 1) second price,what i want is if the user bought with the value of first price and it will show the price and for second price show the second price means on and off in single sumarry payment page.Right now the coding i made only show for just one price (WpForest_price) first price.How to code it using my statement below. This is my code..               if(count($res) > 0){     echo '
';     echo '

';     echo ''.__('Post Name','WpForest').'	';     echo ''.__('Price','WpForest').'	';     echo ''.__('Date Purchased','WpForest').'	';     echo ''.__('Download','WpForest').'	';     echo '

';     //-------------     foreach($res as $row){       if (!empty($row->pid)) {       $post_id = get_post($row->pid);     echo '
';     echo 'ID).'">'.$post_id->post_title .'	';     echo ''.wpforest_currency_simb().get_post_meta( $post_id->ID, 'WpForest_price', true ).' '.  get_option('wpf_paypal_cur').'	';     echo ''.date('d-M-Y',strtotime($row->complete_date)).'	';     echo 'ID.'">'.__('Download Now', 'WpForest').'	';     echo '
';     }      } echo '

';


Set conditional on template based on referring page slug

I have a portion of a page template that is conditional upon the following `elseif`               <?php elseif( isset( $wp_query->query_vars['details'] ) &&  $wp_query->query_vars['details'] == 'child':      Is there a way to exclude a queries from a particular page slug? I would like to exclude queries coming from a page called `services-we-provide`. I tried the following with no luck:                && !$wp_query->query_vars('pagename=services-we-provide')      **EDIT:** I guess another thing I could do is add a `elseif` before the one above that looks to see if you're coming from the services-we-provide page...is that possible, if so, how would I go about that? **EDIT 2:** A little more research and I foudn that this is usually done with a referrer. I found this javascript, however I'm unclear how / where to implement and how to reference in the `elseif` statement: http://stackoverflow.com/a/2163851/745514 Any help would be greatly appreciated.


WordPress aggressively caching CSS

I’m absolutely fed up at this stage. I just activated a new theme on my WordPress site. I activated it at about 7pm GMT and since then I’ve been trying to change the style. I’ve updated the CSS (I’m using SCSS and compiling it into style.css with CodeKit) but the changes don’t take effect. I get the feeling it’s something to do with WordPress because I’ve tried in several browsers and it’s the same — the CSS will not update! It won’t even update locally. For example, I removed a style which was changing a `h1`’s `font-size` to `45px` at a `992px` breakpoint. But it still shows up and beside the style.css there is a version number: ![enter image description here](http://i.stack.imgur.com/ssXNq.png) I’m using Starkers as the starting point for my theme but I don’t think it has anything to do with that. I also tried clearing my browser cache but the fact that the site has the same issue on all browsers leads to believe it’s a WordPress issue.


Show scheduled posts in archive page

I'd like my archive.php page's daily view (is_day) to display scheduled posts (post_status=future). For example, if I go to mysite.com/2011/05/20 I would see all posts scheduled to appear on May 20. The archive page's loop starts with:               if ( have_posts() )     the_post();      and ends with:               rewind_posts();     get_template_part( 'loop', 'archive' );      Do I need to make a second loop, or can I modify this single loop to show scheduled posts? If so, how? Thank you.


Pagenavi Plugin and Custom Post Type - Multipage results

I having trouble with the results, the url and the pagination shows correctly, but when I'm on page 2 or 3 etc... there only show the results from the first page. this is my code.               <?php $portfolioloop = new WP_Query( array( 'post_type' => 'portfolio', 'posts_per_page' => 12 ) ); ?>     <?php while ( $portfolioloop->have_posts() ) : $portfolioloop->the_post(); ?>          Code for the loop here          <?php endwhile; // end of the loop. ?>     <?php if (function_exists('wp_pagenavi')) {     wp_pagenavi( array( 'query' => $portfolioloop ) ); } ?>      WP Page Navi - Versión 2.74 Permalink structure - "/%postname%/"


Multilingual WordPress plugins

I've been using WPML to have multilanguage capabilities in my WordPress implementations. Now WPML has gone commercial, and I'm looking for a open source non-commercial replacement. My main concerns are:   * It should be easy to use for the content administrator.   * It should be fairly flexible.   * It should let me decide the URL structure for each language (subdomain, folder, parameter, etc.)   * It should perform relatively well (Specially the queries)   * It should support all major WP features (eg: Custom post types, menus, widgets) I'm in the process of testing a few plugins, but I'd want to know if any of you have good advice.


Displaying part of every child page?

I have been trying to find a way to return page information in order to create a landing page. I have done this with posts before, to create a blog reel, and would like to achieve the same overall result with pages. **The Scenario:** I use a drop menu with pages created in the WordPress. Nesting the pages builds the menu. **The Goal:** I would like to get the subpages of the parent page. When a user navigates to the parent page I would like it to return links to the subpages with a part of the content of the child page. For example, I would like to display the `<div>` with class `header`. **A Starting Point:**               $mypages = get_pages('child_of='.$post->ID.'&sort_column=post_date&sort_order=desc');          foreach($mypages as $page)     {         $content = $page->post_content;         if(!$content) // Check for empty page             continue;              $content = apply_filters('the_content', $content);     ?>
<a href="<?php echo get_page_link($page->ID) ?>"><?php echo $page->post_title ?>

<?php echo $content ?>
     <?php     }      So far function returns all of `the_content` for all of the children and grandchildren pages. I would like it to specifically return **only 1 div with a specific class** from each child page and **disregard all of the grandchildren** pages.


Font Page overrides rewrites

I have a custom rewrite as follows ![enter image description here](http://i.stack.imgur.com/Z6xRk.png) So `/shares` points to a page I created with a slug `images` which uses a custom query variable named `h626_page`. My problem is I want to set the `images` page as front page, so I go to the admin dashboard, and under **Reading** I set the front page to `images`, nevertheless, that redirects all `/shares` requests to `/`, which isn't a big deal but I lose the query variable in the process, so `/shares/2` redirects to `/` and **even** if I navigate to `/2` and add a rewrite rule `^/(\d+)/?` pointing to the images page, it still doesn't work.


TinyMCE format dropdown no longer showing style previews

In the past, by adding the editor stylesheet, I was able to see the options in both the Format and Styles drop-downs, as they would appear in the post. That is, the entry in the menu would be styled according the the CSS rules that were placed in the editor stylesheet. Strangely, this has stopped working on two sites that have both been updated to WP 3.6. I can still see the custom styles in the editor content window and the styles still apply to the post content - they just don't appear as styled options in the drop-down menu. What is even stranger, is that ONE of the custom rules I have defined DOES display in the drop-down with it's custom style applied. The editor stylesheet is actually the entire front end stylesheet being added via the following and is obviously working because the styles work in the post content;               add_action( 'init', 'pds_add_editor_styles' );     function pds_add_editor_styles()           {                 add_editor_style( 'library/css/style.css' );           }      I'm adding the custom styles via the following;               add_filter( 'tiny_mce_before_init', 'pds_mod_tinymce_editor' );     function pds_mod_tinymce_editor( $init )           {                   $style_formats         = array(                       array(                             'title'    => '90% width (centred)',                             'selector' => '*',                             'classes'  => 'width-90-percent',                             'wrapper'  => true                       ),                       array(                             'title'    => '80% width (centred)',                             'selector' => '*',                             'classes'  => 'width-80-percent',                             'wrapper'  => true                       ),                       array(                             'title'    => '70% width (centred)',                             'selector' => '*',                             'classes'  => 'width-70-percent',                             'wrapper'  => true                       ),                       array(                             'title'    => '60% width (centred)',                             'selector' => '*',                             'classes'  => 'width-60-percent',                             'wrapper'  => true                       ),                       array(                             'title'    => '50% width (centred)',                             'selector' => '*',                             'classes'  => 'width-50-percent',                             'wrapper'  => true                       ),                       array(                             'title'    => 'No space below',                             'selector' => '*',                             'classes'  => 'no-bottom-margin',                             'wrapper'  => true                       ),                       array(                             'title'    => 'Double space below',                             'selector' => '*',                             'classes'  => 'double-bottom-margin',                             'wrapper'  => true                       ),                       array(                             'title'    => 'Small Black',                             'selector' => '*',                             'classes'  => 'small-black',                             'wrapper'  => true                       ),                       array(                             'title'    => 'Big',                             'selector' => '*',                             'classes'  => 'just-big',                             'wrapper'  => true                       ),                       array(                             'title'    => 'Really Big',                             'selector' => '*',                             'classes'  => 'really-big',                             'wrapper'  => true                       ),                       array(                             'title'    => 'Super Big',                             'selector' => '*',                             'classes'  => 'super-big',                             'wrapper'  => true                       ),                       array(                             'title'    => 'RightHeight',                             'selector' => '*',                             'classes'  => 'rightheight-font',                             'wrapper'  => true                       ),                 );                 $init['style_formats'] = json_encode( $style_formats );                      return $init;           }      ![Format drop-down options not carrying styles](http://i.stack.imgur.com/6xlTC.jpg) ![Custom styles drop-down only carrying styles for ONE custom style](http://i.stack.imgur.com/ePp0M.png) On one of my other clients sites the styles work perfectly, as you can see below. This site hasn't yet been updated to 3.6. ![enter image description here](http://i.stack.imgur.com/TgEzO.png) I'm very confused by the situation and don't know what my next step is. I've tried adding only the relevant styles to their own stylesheet and loading that instead of the entire style.css file, but that doesn't work, either. Clearing my cache has no effect. If anyone can offer a little insight, I'd greatly appreciate it. Cheers


Remove capability from specific user

I'm on Wordpress 3.0 and I can't seem to remove a capability from a specific user by the means provided here: http://www.garyc40.com/2010/04/ultimate- guide-to-roles-and-capabilities/ Also, what hook would be good to call it on? I'm calling on admin_init but maybe I should call it on different one. Thanks!


Stop wordpress from creating empty/null entries

Fiddling around with a custom post type which is quite heavy modified. Started doing some testing to see if I had broken some function, and realized that wordpress doesn't have a function that checks if a post has any content at all. Meaning, if I press "Add new" and just press publish, it won't say a word just save the information in the database. The problem is that it's not visible in the admin area, just in the database. An entry with the title Auto Draft and post status auto-draft is created. This isn't the worlds biggest problem, but still I want to avoid to be creating unnecessary entries in the database. So I wonder how I would go about to create some sort of function that checks if any data has been entered in the editor, and if it's blank it'll prompt the user to enter data before saving/publishing the post. The publish meta looks like this:                <?php     if ( !in_array( $post->post_status, array('publish', 'future', 'private') ) || 0 == $post->ID ) {?>          <input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e('Publish') ?>" />         <?php submit_button( __( 'Create' ), 'primary', 'publish', false, array( 'tabindex' => '5', 'accesskey' => 'p' ) );     } else { ?>         <input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e('Save') ?>" />         <input name="save" type="submit" class="button-primary" id="publish" tabindex="5" accesskey="p" value="<?php esc_attr_e('Save') ?>" />     <?php } ?>


How can I convert Posts into Custom type posts?

I have a Wordpress site that I just updated to 3.1. I want to make use of custom post types now, my question is how can I assign (transfer?) a post to a newly created custom post type ? For example, all my articles (news, poems, ideas to change the world) are in Posts. Now I have created the custom post types News, Poems, etc. and I want to transfer my old posts to these new custom post types. I hope this is clear enough, anybody ?


How to prevent spam comments?

I have NoSpamMX plugin installed. I was not getting spam comments for a long time. But now I am getting a lot of spam comments especially in one post. What is the reason that there is such a lot of spams only to that post?


Displaying custom post types as a gallery

This is a bit of a specific question--I have found bits and pieces of information on the net, but nothing that puts the whole picture together for me. Hopefully I can get some help here. Background: I am a newbie to Wordpress. I'm using it as the CMS for a t-shirt shop I'm working on. My 't-shirts' custom post type is set up, but I want to create a 'T-shirts' page that will display all my available t-shirts in a gallery style.   I really don't want to use an e-commerce plug-in because I want a bit more control over how my 'T-shirts' page looks and functions. Problem(s):   1. I need a code that will output the grid layout automatically. Each new 't-shirt' post should occupy the top left grid space. With each new 't-shirt' added, the old ones should automatically shift right to the next space.   If it helps, the rest of my site uses a 16 column 960px grid--ideally each grid space will be 220px wide (4 columns).   2. I have set up the featured image in my 't-shirt' posts as a thumbnail preview, so I'd like the gallery to display JUST the featured image with the title beneath.   3. I want the gallery to begin paginating after about 12 posts. From the little I know about Wordpress, I think I'll need to use some loop functions but I have no clue which ones. Hopefully someone here can help shed some light on this for me.


Auto-Update Plugin Creating .tmp directory, not overwriting old version

I'm using this library to auto-update my plugin, but it's only extracting the new plugin files into a .tmp directory, while the old plugin files stay where they are. Can anybody help me fix this to overwrite the old files or any ideas as to why it would be doing that? Edit: I know that the library above does not actually install the update, but the WP core updater does, so it has something to do with that. Any ideas?


Remove Text within Header tags in the Excerpt

With the default WordPress Excerpt function. WordPress strips the header tags (e.g. h1 tag) but keeps the unformatted text, that lies within the opening/closing of the h1 tag, displayed as part of the excerpt. Is there a way, in addition of striping the h1 tag to also completely remove the text within the tag, when displaying the excerpt? Thanks.


Error message "The page you are looking for is temporarily unavailable." after editing a file

After trying to edit/update a file in the theme editor (file file has write permissions of 666), I get an error message saying "The page you are looking for is temporarily unavailable. Please try again later. " The file never gets updated because the server won't process the change I made to the file. Any ideas?


How to let someone preview a draft?

How can I let a user see my draft post; but don't allow them to edit them? Some context: I'm the only author and admin on my blog. I would like to let someone else read a post before publishing it. None of the builtin roles seems to be a match for this. The role scoper plugin seems a bit too complicated at first sight. What's the easiest way to accomplish that?


Disable a Custom Taxonomies default save mechanism

I have a custom taxonomy X. I've specified that the UI should be shown (for debugging purposes), however the UI is now interfering with my automation. I have code that automatically mirrors terms into this taxonomy, duplicating it. Taxonomy X is effectively a copy of Taxonomy Y or a subset. This code is working almost perfectly, except that my assignment code is doing its work which is then undone by the WordPress UI code setting the terms for the post from the metabox. So how do I make the metabox showing Taxonomy X terms read only? AKA keep the metabox, but remove any save/edit/delete hooks attached to it? _**edit:** for reference, if `show_ui` is set to false in the registration of the taxonomy, and the UI for that tax is hidden, then everything works as expected. ( which itself is to be expected)_


get_template_part() - post-meta not working?

Maybe I simply do not understand what `get_template_part()` is doing … I have a file called `event-list.php` that should work as template for other pages and files so all my events (a custom post type) get listed! Inside this `event-list.php` I have this …               <?php     $loop = new WP_Query( $args );     while ( $loop->have_posts() ) : $loop->the_post();         $wr_event_fields = get_post_custom();         $event_date_timestamp = $wr_event_fields['_wr_event_date'][0];         $event_date = strftime('%d.%m.%Y', $event_date_timestamp);         $event_time = $wr_event_fields['_wr_event_time'][0];         $event_speaker = $wr_event_fields['_wr_event_speaker'][0];           //get_template_part( 'event-item' );     ?>                  <div id="event-<?php the_ID(); ?>" <?php post_class(); ?>>
<?php echo $event_date; ?>

<?php echo $event_time; ?>

<?php echo $event_speaker; ?>

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

<?php the_excerpt(); ?>

                   <?php endwhile; ?>      So what I want to do is include another template inside of `event-list.php` named `event-item.php` which only holds the layout of an event. I want to use this `event-item.php` maybe later also in different loops. It should just be the markup for each single event-item on my website. If I make a change inside of this `even-item.php` template all "events" in any of my loops on my entire website should change. The problem I have with this is the one in the above sample code. I use `get_template_part( 'event-item' );` to include the `event-item.php` layout structure within my loop. And I get its custom post-meta outside of this template. However that does not work! As you can see in my sample above I have to copy the entire layout structure from my `event-item.php` inside of my `event-list.php` so the post-meta stuff is filled in. Any ideas what I don't get here or what I'm doing wrong here? Thank you in advance. Matt


enabling custom fields in admin?

i've found out that there are custom fields but i'm not able to activate them in the admin panel .. :( i've checked the screen options but there's no custom fields - looks like it depends on the template i'm using. any ideas how to modify it in order to enable custom fields for posts? thx


users table - user_name vs. nicename

Can someone explain the differences or different uses of the user_name and user_nicename fields in the users table? They seem to be, and behave the same. I found a bunch of posts in web searches, but they are relevant only to older version of wp.


Dropdown login without plugin

I would like to enter the site I'm trying to create a log in the dropdown in the header of the website. (I know there are plugins but I'm trying to accomplish each function without external plugins to rely as much as possible). I found this guide http://red-team-design.com/simple-an...own-login-box/ I'm returning to my site. I entered inside my header.php this line of code:

     <?php               wp_login_form();     ?>

           I then inserted, just after the script                     And placed in the child theme all styles css (I tried both their default some customizations). On the home page everything works perfectly, in the sense that belonging log in dropbown. If I go in the other pages of the site (for example, about, contacts, recent posts, etc.), if I click on "login" does not appear on the dropdown and the url becomes www.miosito.it/about/ # Why is this happening? How can I fix and operate the dropdown on each page? Thank you all


How Can i Get 5 Recent Post Title With Corresponding Link?

I Want to Add My Latest 5 Post Title with Corresponding Link in My Header Position.What was the Actual Php code?Am Newbie ....


How to know if a tag has been added within a taxonomy?

I have a custom form field within a taxonomy. However when a new term/tag has been added I need to clear some values through javascript. How can I do this? I found the following code snippet in WordPress:               a.post(ajaxurl,a("#addtag").serialize(),function(h)     {         a("#ajax-response").empty();              var f=wpAjax.parseAjaxResponse(h,"ajax-response");              if(!f||f.errors){return}          var g=b.find("select#parent").val();          if(g>0&&a("#tag-"+g).length>0){         a(".tags #tag-"+g).after(f.responses[0].supplemental.noparents)}     else         {a(".tags").prepend(f.responses[0].supplemental.parents)}          a(".tags .no-items").remove();          if(b.find("select#parent")){          var e=f.responses[1].supplemental;     var c="";          for(var d=0;d<f.responses[1].position;d++){c+="   "}          b.find("select#parent option:selected").after('<option value="'+e.term_id+'">'+c+e.name+"</option>")}          // = NOTE THE FOLLOWING LINE =============     a('input[type="text"]:visible, textarea:visible',b).val("")});     // =======================================          return false})});      It clears all the text input fields that are visible, however I have my own custom field that people can select an image and after the image has been selected a hidden input field value is changed with the selected image id and the image is shown through an image object. However, after the user presses the 'Add new category' button I like to be able to reset the hidden input field and remove the image object. I like to know when a category has been added so I can reset all that is necessary.


How to make widget title accept php?

I am trying to make widgets accept php, but without resorting to plugins. So far I have enabled php for the widget_text but cant make it work for widget_title. I am using the following code in functions.php:               add_filter('widget_text','execute_php',100);     function execute_php($html){          if(strpos($html,"<"."?php")!==false){               ob_start();               eval("?".">".$html);               $html=ob_get_contents();               ob_end_clean();          }          return $html;     }      What would I have to do to enable php in the title as well?


SymmetricDS in dev + prod workflow?

Has anyone leveraged SymmetricDS in their development and production efforts so as to keep the environments synchronized? We have a number of WordPress sites that need to be kept in synch. In our scenario we have a "master" wordpress project that is developed between a few developers and this master get's duplicated out on new deployments as well as pushed out to update old deployments. We have been considering using ManageWP or the Duplicator plugin, however it just is not optimal in really getting updates out in a tracked fashion that we'd like to see. Our goal is to use Git + some kind of db synchronization (appears it will be SymmetricDS) in order to synchronize the code and databases while leaving the config files specific to the sites, similar to how Rails devs handle the deployment convention generally. But with this, I was hoping to find someone who may be using SymmetricDS with some degree of success already in such a scenario who could share some light on how they have it set up so as to handle the custom database components that WordPress will have from site to site and dev site to prod site. It seems to be possible given the customization factor of SymmetricDS, but not yet clear.


Display Menu Name using wp_nav_menu

I have a custom menu that I can call just fine using wp_nav_menu. Is there a way to have the menu name displayed inside an h3 tag before the menu? Ex.
My Menu Name

Menu Item 1

Menu Item 2


Wordpress plugin/code to hide all things related of a user from the public

I am looking for a plugin or a code that will allow admin to hide all things related to a specific user. Not to delete it, just to hide it from the public. Something like to be unable to viewed from the visitors and other users. This should include posts, author page and comments if it is possible. Thank you for your suggestions.


Best Plugin to Reorder Post Types

I'm looking for a plugin that enables me to reorder pages, posts and custom post types from the normal listing in the WordPress dashboard. The closest plugin I've found is Simple Page Ordering http://wordpress.org/extend/plugins/simple-page-ordering/ however this plugin does not allow post ordering, and also does not easily allow building hierarchies. So I'm looking for a plugin that does the above but adds support to posts and also enables hierarchies. I like the way the WordPress menu builder lets you add hierarchies by moving a sub page to the right until it attaches itself as a sub-menu. Another plugin, CMS Tree Page View, does this very well but has its own interface, while I'd prefer using the native interface of WordPress. Any suggestions?


Schedule future post to custom post status instead of publish?

I've been doing some research into custom post statuses and scheduling posts and I had a question: I was wondering if it were possible to schedule a post to got from `future` to a custom post status instead of `publish`? Main reason I'm asking is that I have a custom post type called `stream` and I've created a custom publish meta box that allows a user to select 2 post statuses: `online` and `offline`. I'm trying to make it so that if I set a future date, the stream post will transition to `online` instead of `publish` as it normally would. My train of thought would be to hijack via filter the post status to automatically transition to `online` whenever WordPress tries to set it to `publish`. Would that be a viable option?


How to apply filter inside a single wp_query?

I've got a special query on my homepage that returns posts from a custom taxonomy. I'm trying to apply this filter for it.               add_filter( 'post_limits', 'my_post_limits' );          function my_post_limits( $limit ) {                                     if ( is_home() ) {                                         return 'LIMIT 0, 3';                                     }                                     return $limit;                                 }      However, this is also applied to my other loop that's further down the page, so I'm guessing it's something that's not supposed to be set globally. I don't have much backend knowledge and can't figure out how to apply a filter such as this only inside my custom query. Is this possible ? This is how my full query looks :               add_filter( 'post_limits', 'my_post_limits' );     function my_post_limits( $limit ) {     if ( is_home() ) {         return 'LIMIT 0, 3';     }     return $limit;     }          $args = array(     'post_type' => array('post','featured-post'),     'tax_query' => array(         array(             'taxonomy' => 'featured',             'field' => 'slug',             'terms' => 'featured-homepage'         )          )     );     $slider_query = new WP_Query( $args );     if ( $slider_query->have_posts() ):          while ( $slider_query->have_posts() ) :         $slider_query->the_post();         $tip_post=get_post_type();         if (get_post_type()=='post') {                  $thumb = wp_get_attachment_image_src(     get_post_thumbnail_id($post->ID), 'bones-thumb-1280' );             $url = $thumb['0'];       // posts are here     } elseif(get_post_type()=='featured-post') {       // custom posts are here     } endwhile; else: endif;


Include admins in author drop-down on edit post screen

In the back-end when editing a post there is a dropdown to select post author which is populated by registered usernames. But, users with an admin role do not appear in the list, there is an "Admin" which appears top of the list. That means the only way to assign a post to a particular user with role = admin is to go into phpMyAdmin and manually update the entry in the wp_post table. Anyone know how to override the behaviour that removes admins from the dropdown? [EDIT] I inherited my theme files from someone else and now see that they had added a function in functions.php to manipulate the dropdown (I have CPTs which can be posted via forms on the front-end. All my users are subscribers, and so to be able to reassign posts in the back-end, that dropdown box is rebuilt to include users with role = subscriber. The admins hadn't been properly added back in.) For the record, anyone looking to manipulate that dropdown for whatever reason, you can hook into the filter `wp_dropdown_users` ) [/EDIT]


How to only show parent categories in sidebar? But also when browsing posts, to show all the subcategories of the parent category the current post is in, showing the hierarchy. the other parent categories will also be displayed, but only the one that the post is in will reveal the subcategories. So basically show the subcategories of a parent category only when viewing a post in that parent category. Example:               on single.php      for example, if there are 3 parent categories, with subcategories:          Fruits (parent)      Apples      Plums     Veggies (parent)      Tomatoes      Onions     Nuts (parent)      Peanuts      Almonds          if the post is in subcategory Apples, the sibear should show:          Fruits       Apples      Plums     Veggies      Nuts           if the post is in subcategory Almonds, the sibear should show:          Fruits     Veggies     Nuts      Peanuts      Almonds          on anything else (index, category pages) sidebar should only show parent categories, no subcategory.