WordPress.org

Support

Support » Plugins and Hacks » [Resolved] Limit if is_home / is_frontpage to the first page worth of posts

[Resolved] Limit if is_home / is_frontpage to the first page worth of posts

  • Hi

    Is there a way to use if is_home or is_front_page to only return positive on the first page of results?

    I’ve got posts per page set to 5, but when I hit the “previous posts” link to go to the next page of results the is_home or is_frontpage is still giving me a positive result (showing the word “test”).

    My code is:

    <?php if (is_home() ) { echo '<a>test</a>' ;} else { echo '<a href="[blog url]">home <span class="greydot">&bull;</span></a>' ;} ?>

    or

    <?php if (is_front_page() ) { echo '<a>test</a>' ;} else { echo '<a href="[blog url]">home <span class="greydot">&bull;</span></a>' ;} ?>

    thanks,
    mattg.

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Resolved] Limit if is_home / is_frontpage to the first page worth of posts’ is closed to new replies.
Skip to toolbar