is_page() function problem (1 post)

  1. btard
    Posted 7 years ago #

    I am trying to use the is_page() function with a text argument to test if the page is a certain type. I am trying two things:

    example 1

    <?php if(is_page('bad page')) : ?>
    <p>this is "bad page" (title)</p>
    <?php endif; ?>


    example 2

    <?php if(is_page('bad-page')) : ?>
    <p>this is "bad-page" (page slug)</p>
    <?php endif; ?>

    example 1 - i am testing for the page title ("bad page")
    example 2 - i am testing for he page slug ("bad-page")

    I am using this in the footer.php file in the WordPress default theme, it's not working in any case, any ideas?

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.