WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Condition for "only on page 1 but not page 2" (3 posts)

  1. thelaw
    Member
    Posted 1 year ago #

    I don't see the following in the codex:

    If on page 1 of results but not on page 2. For example, let's say you have a category page with 5 pages of posts results. You can say the same for a post with 4 additional pages of text. Is there a conditional that says "show on the first page but on the remaining pages."

  2. alchymyth
    The Sweeper & Moderator
    Posted 1 year ago #

    <?php if( !is_paged() ) : ?>
    page 1 only output
    <?php endif; >

    http://codex.wordpress.org/Conditional_Tags#A_Paged_Page

  3. thelaw
    Member
    Posted 1 year ago #

    SUPERB! Many thanks!!!! Couldn't find this one...

    One note -

    Add question mark at end of last endif tag.
    <?php endif; ?>

Topic Closed

This topic has been closed to new replies.

About this Topic