WordPress.org

Ready to get started?Download WordPress

Forums

How to nest multiple conditional tags? (7 posts)

  1. Bill
    Member
    Posted 3 years ago #

    How does one combine or "nest" more than one conditional tag?

    For example: Let's say I want to create a test that is true under either of the following conditions:
    is_page('128') or
    is_single()

    thanks!

  2. esmi
    Theme Diva & Forum Moderator
    Posted 3 years ago #

    if( is_page('128') || is_single() )

  3. Bill
    Member
    Posted 3 years ago #

    Thanks Esmi!

    I mostly follow.

    Can you point me to a description of special page numbers like '128', and '039'? Is there something in the codex? I couldn't find it.

    Bill

  4. equalmark
    Member
    Posted 3 years ago #

    I would start by looking at the WordPress Codex Conditional Tags page:

    http://codex.wordpress.org/Conditional_Tags

  5. esmi
    Theme Diva & Forum Moderator
    Posted 3 years ago #

    The numbers are ids of Pages, Posts etc. Essentially, they are the record (row) numbers in the database for that object See How do I find an id?

  6. Bill
    Member
    Posted 3 years ago #

    I think that will put me in business for the time being.

    Thanks for your help Esmi and Mark!

    Bill

  7. esmi
    Theme Diva & Forum Moderator
    Posted 3 years ago #

    No problem :-)

Topic Closed

This topic has been closed to new replies.

About this Topic