WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Limiting number of posts in the loop on home.php (3 posts)

  1. vavroom
    Member
    Posted 6 years ago #

    I know I can set the number of posts to display in the Loop through the admin panel, but this applies to home page, archives, categories, etc.

    I need to limit the posts differently on the front page than I do on the rest of the site. I've looked through the codex, searched the forum, etc. I can't seem to figure it out. I suspect it's real obvious, but can't seem to find it.

    Any help would be greatly appreciated.

  2. Ivovic
    Member
    Posted 6 years ago #

    you want to add 'showposts=3' or the number of your choice, to the query_posts function in the loop.

    check out the query_posts() codex page for details.

  3. vavroom
    Member
    Posted 6 years ago #

    Thank you! That did it, with a bit of fiddling. I couldn't make sense of query_post, thinking it had to be before the loop, but got it working in the end.

    Many thanks

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags