Highlight parent page that lists custom post type
-
I’m using this string of php (along with some css) to highlight the current page of my website:
<ul> <li><a href="/portfolio" <?php if (is_page('portfolio')) {echo " id=\"current\"";} ?>>Portfolio</a></li> <li><a href="/about" <?php if (is_page('about')) {echo " id=\"current\"";} ?>>About</a></li> <li><a href="/blog" <?php if (is_page('blog')) {echo " id=\"current\"";} ?>>Blog</a></li> </ul>
At the moment it works, but my portfolio page is populated by a custom post type (in theory that would make it a parent page). When I select a portfolio entry (child page), I would like the link for the parent page to remain highlighted in the navigation. Is this possible and if so, then how?
I’m using a customized version of the Starkers theme.
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘Highlight parent page that lists custom post type’ is closed to new replies.