• Resolved mzimmers

    (@mzimmers)


    I’ve read up on the is_page() tag, and I can see how to choose a banner image based on what Page is displaying. What I’d *really* like to do, though, is to choose a banner image if a child Page is displaying as well. So, for example, I’d like image3.jpg to display if I’m currently on Page 3, Page 3.1, Page 3.2, etc.

    Is there an efficient way to do this, or do I have to hard-code each Page number into a separate test?

    Thanks…

Viewing 5 replies - 16 through 20 (of 20 total)
  • anyone?

    Moderator Samuel Wood (Otto)

    (@otto42)

    www.ads-software.com Admin

    is_page() does work just fine. I’m not sure what you’re asking here.

    otto, try using is_page() on a page that has children, and/or that is a child…

    doesn’t work…

    I’m tearing my hair out over the same issue – has anyone gotten this to work? I just can’t get WP 2.5 to recognize parent/child/grandchild pages properly.

    I need something that works likes Otto’s example above, but I get a parse error when using that exact example. It’s on line 29, which is:

    <?php global $wp_query; if( has_parent($wp_query->post), 5)) :?>

    Anyone know what I’m doing wrong?

    Well for one thing, you have an extra parentheses at the end of the IF statement.

    It should read:

    <?php global $wp_query; if(has_parent($wp_query->post), 5) :?>

Viewing 5 replies - 16 through 20 (of 20 total)
  • The topic ‘using is_page with children pages?’ is closed to new replies.