• WildBil2Me

    (@wildbil2me)


    I know that the ‘is_page’ tag can be used to test for Pages like the “About” page.

    I’m looking for a way to test for the pages that appear as part of a site’s history.

    Specifically I’d like something to appear on the index page but not on the past post pages that appear after it.

    For example:
    I’d like the index page (mysite.com) to display “This is the index” but I’d like the “previous posts” pages (mysite.com/page/2) to not display it.

    Any thoughts?

Viewing 3 replies - 1 through 3 (of 3 total)
  • rudolf45

    (@rudolf45)

    http://codex.wordpress.org/Conditional_Tags

    1. is_home
    2. NOT is_paged

    Thread Starter WildBil2Me

    (@wildbil2me)

    Thanks rudolf,

    If I’m reading this right the PHP would look like

    if ((is_home()) && !(is_paged()) {}

    I’ll give it a try and check back.

    rudolf45

    (@rudolf45)

    Honestly, I am not so good at coding… 🙁 – so I cannot say whether the code is OK or not.
    The only thing I know, it should be something along those lines. Maybe some PHP guru can confirm or correct your line.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Testing for pages (not Pages)’ is closed to new replies.