WordPress.org

Ready to get started?Download WordPress

Forums

apply conditional statments to category and any of its children (2 posts)

  1. oldbag66
    Member
    Posted 5 years ago #

    Hi to save me writing numerous else if statements i want to apply one elseif to a catagory and any of its children and sub children etc

    so far i have this:

    <?php } elseif ( is_category('3',)) {	?>
    <p>some thing that applies to these categories here</p>

    I guess i need to get this bit right:
    <?php } elseif ( is_category('3',)) { ?>

  2. oldbag66
    Member
    Posted 5 years ago #

    also i want to apply this idea to is_page im guessing itll be the same solution?

    instead of this:
    <?php } elseif ( is_page(array ('71', '73', '75', '77', '81', '61','83', '85', '87', '89', '91', '69', '93', '95', '97', '99', '67', '101'))) { ?>

    these are all children i would just like to say apply this statement to all children (sub pages) of this page

    ..hope that makes sense!

Topic Closed

This topic has been closed to new replies.

About this Topic