Forums

[resolved] how to identify more than one page in using conditionals (3 posts)

  1. smoo
    Member
    Posted 1 year ago #

    Hi,
    I'd like to know the syntax to identify more than one page in order to use a conditional statement;

    I've used

    if (is_page('pagename1'))
    { then do something }

    but how would you say

    if (is_page('pagename1 or pagename2 or pagename3')) {
    then do something }

    ?
    Thanks in advance for any help

  2. MichaelH
    Volunteer
    Posted 1 year ago #

    In the example from http://codex.wordpress.org/Conditional_Tags#A_PAGE_Page

    if ( is_page(array(42,'about-me','About Me And Joe')) ) {
    //do something
    }
  3. smoo
    Member
    Posted 1 year ago #

    Brilliant, thank you MichaelH!

Topic Closed

This topic has been closed to new replies.

About this Topic