Forums

How do I apply a specific class to a PAGE and all of its CHILD PAGES (1 post)

  1. Ninja Master Jimmy Wong-Fu
    Member
    Posted 1 year ago #

    For example:

    <li<?php if (is_page('12')) {echo ' class="current_page_item"'; }?>><a href="index.php?page_id=12" id="history"></a></li>

    Simple enough. If this is page 12 the class current_page_item is applied.

    I understand how to apply a class to a category but how would I modify the code to apply the class to a page and all of its child pages?

    Rock on

    J Fu

Topic Closed

This topic has been closed to new replies.

About this Topic

  • RSS feed for this topic
  • Started 1 year ago by Ninja Master Jimmy Wong-Fu
  • This topic is not resolved
  • WordPress version: 3.0