I have a featured posts slider on my site's front page. It displays n posts (5 right now) from the category featured. If I have 5 posts in that category, and publish a 6th, the oldest of the 6 doesn't show up in the slider or below in the list of all recent posts. My solution right now is to go to All Posts > Published > Featured, pick one to un-feature, and go on with my life.

I'll take suggestions on a better solution (fix the featured slider is probably a decent response), but what I'm looking for here is a way to add a link to All Posts that will show me all published featured posts.

enter image description here

  • Hint: That's bulk_actions
    – kaiser
    Feb 28 '12 at 17:41

First of all in your image you can see that WordPress lets you filter the posts by category, just bellow the what you have added to the image, But if you want to know how you can add your own link to the filter you can use the views_edit-post filter hook ex:

add_action('pre_get_posts', 'query_add_filter' );
function query_add_filter( $wp_query ) {
    if( is_admin()) {
        add_filter('views_edit-post', 'Add_My_filter');

// add filter
function Add_My_filter($views) {
    global $wp_query;
    $my_cat = YOUR-CAT-ID

    $query = array(
        'author'      => $current_user->ID,
        'post_type'   => 'post',
        'post_status' => 'publish',
    'cat'         => $my_cat
    $result = new WP_Query($query);
    $class = ($wp_query->query_vars['cat'] == 'featured') ? ' class="current"' : '';
    $views['publish_f'] = sprintf(__('<a href="%s"'. $class .'>Publish Featured <span class="count">(%d)</span></a>', 'publish featured'),

    return $views;

just make sure you change YOUR-CAT-ID to the actual category id

  • Just to clarify, my current process is: load all posts, load all published posts, filter by featured category. I'm just trying to cut down on loads. Thanks for this answer, I'll play with this tonight and get back to you. Feb 28 '12 at 19:54
  • Well it makes more sense now that you clarified :) let me know how it works.
    – Bainternet
    Feb 28 '12 at 21:21
  • I'm finally getting to this.. Where would this hook go? wp-admin/includes/admin.php? Or some other location? Mar 8 '12 at 20:34
  • That worked. I made a plugin for it. Thank you so much! Mar 8 '12 at 21:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.