WordPress.org

Ready to get started?Download WordPress

Forums

is_page() function problem (1 post)

  1. btard
    Member
    Posted 6 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; ?>

    and

    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

Tags

No tags yet.