Forums

is_page Question (3 posts)

  1. neoian2
    Member
    Posted 4 years ago #

    I am using the following to put this class on a div if it is the current page.

    <?php
    if (is_page('12'))
    {
    echo ".current";
    }
    ?>

    It does not work with more than one page listed though. I tried:

    <?php
    if (is_page('12,13,14,15,16,17,18,19,20,21,22,23'))
    {
    echo ".current";
    }
    ?>

    but it didn't work. How do I go about making it work?

  2. whooami
    Member
    Posted 4 years ago #

    2.3.x:

    if (is_page('12') || is_page('13')) .. so on..

    2.5:

    is_page(array(12,13,14,15'))

    Use the codex and search, grasshopper.

  3. neoian2
    Member
    Posted 4 years ago #

    Ok. Thanks a lot!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.