Limit the number of posts shown

When displaying a list of posts, Display Posts uses the number you have set in Settings > Reading > “Blog pages show at most” by default.

But you can change this using the posts_per_page parameter in a shortcode. For instance, if you only wanted to list two posts, use:

[display-posts posts_per_page="2"]

If you want to list every post, you can use a really high number:

[display-posts posts_per_page="-1"]

Published by Bill Erickson

Bill Erickson is a freelance WordPress developer and a contributor to the Genesis framework. For the past 14 years he has worked with attorneys, publishers, corporations, and non-profits, building custom websites tailored to their needs and goals.

Join the Conversation

  1. Hi Bill,

    Firstly, I would like to express my deepest appreciation for your development of this extremely nifty WP plugin. Question: is there a way to add page links to previous posts in the homepage when using the posts_per_page parameter, in the same vein as in a basic “Your latest posts” setting of the home page?

    Hoping for your kind consideration and assistance. 🙂

    Regards,
    Jan

    1. Unfortunately no, this plugin does not currently support pagination. We plan to add this at a future date, and you can follow its development here.

Leave a comment

Your email address will not be published. Required fields are marked *