WordPress.org

Ready to get started?Download WordPress

Forums

multiple is_page() (3 posts)

  1. baszer
    Member
    Posted 1 year ago #

    hello,

    is it allowed to have 2 (or more) is_page() on your page?

    i have

    <?php if ( is_page(92) ) {
    echo 'page 92';
        } elseif ( is_page(93) ) {
    echo 'page 93';
    } else { echo 'else';} ?>

    what works ok, but when I add another is_page(92) on another spot, it only gives the else. So is it not allowed to have more is_page() ?

  2. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

    You can have as many is_page() conditionals as you need. My guess is that its their placement or your logic that's causing the problem.

  3. baszer
    Member
    Posted 1 year ago #

    thank you for your answer, I think you are right, I now did it some other way.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.