WordPress.org

Support

Support » Themes and Templates » apply conditional statments to category and any of its children

apply conditional statments to category and any of its children

  • 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',)) { ?>

Viewing 1 replies (of 1 total)
  • 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!

Viewing 1 replies (of 1 total)
  • The topic ‘apply conditional statments to category and any of its children’ is closed to new replies.
Skip to toolbar