WordPress.org

Support

Support » Themes and Templates » multiple is_page()

multiple is_page()

  • 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() ?

Viewing 2 replies - 1 through 2 (of 2 total)
  • esmi

    @esmi

    Forum Moderator

    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.

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

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘multiple is_page()’ is closed to new replies.
Skip to toolbar