Title: [Plugin: Display Posts Shortcode] display posts from all categories
Last modified: August 20, 2016

---

# [Plugin: Display Posts Shortcode] display posts from all categories

 *  Resolved [raskull](https://wordpress.org/support/users/raskull/)
 * (@raskull)
 * [14 years, 1 month ago](https://wordpress.org/support/topic/plugin-display-posts-shortcode-display-posts-from-all-categories/)
 * How can I display posts from all categories, and the right number of them?
 * `[display-posts posts_per_page="6"]` returns 8 instead of 6 posts. Same for this:`[
   display-posts category="" posts_per_page="6"]`
 * How can I display posts from all categories, and all of them?
 * `[display-posts]` returns less than all of them.
 * [http://wordpress.org/extend/plugins/display-posts-shortcode/](http://wordpress.org/extend/plugins/display-posts-shortcode/)

Viewing 6 replies - 1 through 6 (of 6 total)

 *  Plugin Author [Bill Erickson](https://wordpress.org/support/users/billerickson/)
 * (@billerickson)
 * [14 years, 1 month ago](https://wordpress.org/support/topic/plugin-display-posts-shortcode-display-posts-from-all-categories/#post-2715876)
 * You must have a plugin interfering with the query. Have you tried disabling other
   plugins?
 * [display-posts posts_per_page=”6″] will work assuming you don’t have a theme 
   or plugin that’s poorly constructed and breaks other queries.
 *  Thread Starter [raskull](https://wordpress.org/support/users/raskull/)
 * (@raskull)
 * [14 years, 1 month ago](https://wordpress.org/support/topic/plugin-display-posts-shortcode-display-posts-from-all-categories/#post-2715879)
 * I have pinpointed the problem: Sticky posts.
 * Posts that are designated as sticky posts appear *in addition* to the number 
   of posts_per_page requested.
 * To see this in action, request, say, 3 posts, and make sticky a post that is 
   not within the 3 most recent posts. You should see 4 posts, with the sticky in
   the first position.
 * I fixed it by adding `'ignore_sticky_posts' => 1` to the below. This prevents
   stickies from showing at the top but will leave them showing in their natural
   order by date, if they happen to fall within the requested number of posts:
 *     ```
       // Set up initial query for post
       	$args = array(
       		'post_type' => $post_type,
       		'tag' => $tag,
       		'category_name' => $category,
       		'posts_per_page' => $posts_per_page,
       		'order' => $order,
       		'orderby' => $orderby,
       		'ignore_sticky_posts' => 1
       	);
       ```
   
 * If you agree, perhaps you could update the plugin so I don’t have to hack it 
   and babysit it?
 *  Plugin Author [Bill Erickson](https://wordpress.org/support/users/billerickson/)
 * (@billerickson)
 * [14 years, 1 month ago](https://wordpress.org/support/topic/plugin-display-posts-shortcode-display-posts-from-all-categories/#post-2715887)
 * I don’t think it’s necessary to modify the plugin and issue an update for this.
   If you are using sticky posts, this is the expected behavior.
 * If you use them and don’t want them showing up in your shortcode’s listing, add
   this to your theme’s functions.php file or your [core functionality plugin](http://www.billerickson.net/core-functionality-plugin/):
 *     ```
       function be_exclude_sticky_from_display_posts( $args ) {
       	$args['ignore_sticky_posts'] = 1;
       	return $args;
       }
       add_filter( 'display_posts_shortcode_args', 'be_exclude_sticky_from_display_posts' );
       ```
   
 *  Thread Starter [raskull](https://wordpress.org/support/users/raskull/)
 * (@raskull)
 * [14 years, 1 month ago](https://wordpress.org/support/topic/plugin-display-posts-shortcode-display-posts-from-all-categories/#post-2715888)
 * Hm, I guess you are right about that! Though it’s not the behavior I would expect—
   but that’s WP’s fault, not yours. Thank you for the filter!
 *  Thread Starter [raskull](https://wordpress.org/support/users/raskull/)
 * (@raskull)
 * [14 years, 1 month ago](https://wordpress.org/support/topic/plugin-display-posts-shortcode-display-posts-from-all-categories/#post-2715890)
 * I just wanted to clarify, though, for others that may be following, that ignore_sticky_posts
   doesn’t actually ignore those posts (for the shortcode or anything else). It 
   just relieves them of sticky duty.
 * Instead of their busting out of chronological order to the top of the posts and
   appending themselves to the requested number of posts, they just wait their turn.
   That is to say, they act like regular posts.
 * Personally, I find it odd that anyone would want their blog’s “read me” stickies
   to be stuck to the thing that might have led them to this plugin in the first
   place.
 *  Plugin Author [Bill Erickson](https://wordpress.org/support/users/billerickson/)
 * (@billerickson)
 * [14 years, 1 month ago](https://wordpress.org/support/topic/plugin-display-posts-shortcode-display-posts-from-all-categories/#post-2715896)
 * I completely agree, which is why I never recommend using sticky posts. It’s a
   relic of early versions of WordPress.
 * If you want information at the top of your blog, add a widget area to your theme
   so you can manage it with a text widget.

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘[Plugin: Display Posts Shortcode] display posts from all categories’ 
is closed to new replies.

 * ![](https://ps.w.org/display-posts-shortcode/assets/icon-256x256.jpg?rev=2940963)
 * [Display Posts - Easy lists, grids, navigation, and more](https://wordpress.org/plugins/display-posts-shortcode/)
 * [Support Threads](https://wordpress.org/support/plugin/display-posts-shortcode/)
 * [Active Topics](https://wordpress.org/support/plugin/display-posts-shortcode/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/display-posts-shortcode/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/display-posts-shortcode/reviews/)

 * 6 replies
 * 2 participants
 * Last reply from: [Bill Erickson](https://wordpress.org/support/users/billerickson/)
 * Last activity: [14 years, 1 month ago](https://wordpress.org/support/topic/plugin-display-posts-shortcode-display-posts-from-all-categories/#post-2715896)
 * Status: resolved