Support » Themes and Templates » is_page() function problem

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

  • The topic ‘is_page() function problem’ is closed to new replies.