WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Number of blog entries on first page (3 posts)

  1. McDragon
    Member
    Posted 5 years ago #

    I have looked through the documentation and forums for this one, I think it might need tweaking the design, but I think this should really be part of the Settings - Reading (setup).

    I want to control the number of blog entries on the first page, in my case I want just the one, the latest one.

    I tried using the »Blog pages show at most« bit that affects everything including the archive view. I think this could be really a feature request but cannot wait that long and wish to solve it now.

  2. McDragon
    Member
    Posted 5 years ago #

    Isn't this just typical, I ask a question only to find the answer soon after myself.

    As index.php is usually the first page displayed you have to go into the template and add the following line of PHP code just immediately after the have_posts check ... if (have_posts() ...

    <?php query_posts('showposts=1'); ?>

    This will work, however I would still route for a setting on the Settings page :-)

  3. McDragon
    Member
    Posted 5 years ago #

    By the way, the documentation for this is here:
    http://codex.wordpress.org/Template_Tags/query_posts

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.