• Resolved potatrick

    (@potatrick)


    I’m totally new to php and this is my first WordPress site. I’ve learned a ton from just reading these forums the past month, so thank you in advance. I’ve successfully made my navigation highlight on current pages, but I can’t seem to figure out how to keep the same ‘about us’ link on the nav menu highlighted when going to the children of the about us page. Here is the code I’ve got so far:

    <ul id='navlist'>
    
    <li class="page_item page-item-17<?php if(is_home()) echo ' current_page_item'; ?>"><a href="/epiphany/">main</a></li>
    
    <li class="page_item page-item-36<?php if(is_page('about-us')) echo ' current_page_item'; ?>"><a href="/epiphany/about-us/">about&nbsp;us</a></li>
    
    <li class="page_item page-item-7<?php if(is_page('sermons')) echo ' current_page_item'; ?>"><a href="/epiphany/sermons/">sermons</a></li>
    
    <li class="page_item page-item-372<?php if(is_page('news-events-2')) echo ' current_page_item'; ?>"><a href="/epiphany/news-events-2/">news&nbsp;&&nbsp;events</a></li>
    
    <li class="page_item page-item-17<?php if(is_page('community')) echo ' current_page_item'; ?>"><a href="/epiphany/community/">community</a></li>
    
    <li class="page_item page-item-16<?php if(is_page('contact')) echo ' current_page_item'; ?>"><a href="/epiphany/contact/">contact</a></li>
    
    </ul>

    I need the pages ‘about-us/find-us’ and ‘about-us/new-members’ to be included in the ‘about us’ highlight.

Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘current_page_item nav highlight for page children’ is closed to new replies.