Forums

[resolved] Excluding latest post from the Loop (4 posts)

  1. Jusi
    Member
    Posted 2 years ago #

    Hi all,

    How can I exclude the latest post from the Loop?

    There was a similar post a year ago but it didn't get solved, Google doesn't have an answer either. What I'm trying to achieve is a simple query that will exclude one latest post. Not some ID, not posted at some specific date or time, just the latest one.

    Thanks in advance.

    Justine

  2. Mark / t31os
    Moderator
    Posted 2 years ago #

    Use the offset parameter in the query_posts.

    http://codex.wordpress.org/Template_Tags/query_posts#Offset_Parameter

  3. MichaelH
    Volunteer
    Posted 2 years ago #

    To skip the latest post, using the WordPress Default theme for example, in the wp-content/themes/default/index.php file, just before the line:

    <?php if (have_posts()) : ?>

    put this:

    <?php query_posts($query_string . '&orderby=date&order=ASC'); ?>

    The query_posts() article explains the arguments in detail.

    `

  4. Jusi
    Member
    Posted 2 years ago #

    Thank you, got it working now.

    Justine

Topic Closed

This topic has been closed to new replies.

About this Topic