I have created a Menu (for the nav bar) it is placed in a copy of the header.php file in my child theme right below:
<?php wp_nav_menu( array( 'container_class' => 'menu-header', 'theme_location' => 'primary','container' => '' ) ); ?>
It works fine EXCEPT the CSS for the Active Selected menu item is not working for everything but “Home”.
This changes the background for “Home” when selected but none of the other top menu items.
#access ul li.current_page_item > a, #access ul li.current-menu-ancestor > a, #access ul li.current-menu-item > a, #access li.selected > a, #access ul li.current-menu-parent > a, #access ul li.current_page_item, #access ul li.current-menu-item, #access li.selected {
background-color: #1E0D51 !important;
}
All the CSS does show up for Hover.
I have spent hours on this and can not figure out what the problem is.
Any insights or ideas are gratefully appreciated.
Thanks
Tim
Place in header.php after <?php wp_nav_menu( array( 'container_class' => 'menu-header', 'theme_location' => 'primary','container' => '' ) ); ?>
<ul>
<?php if ( is_user_logged_in() ) { ?>
<li class="menu-item"id="menu-item-22"> <a href="<?php echo bp_loggedin_user_domain() ?>activity/just-me/">My Wall</a>
<ul class="sub-menu">
<li class="menu-item"> <a href="<?php echo bp_loggedin_user_domain() ? >activity/friends/">My Friends' Activities</a></li>
<li class="menu-item"> <a href="<?php echo bp_loggedin_user_domain() ? >profile/edit/group/1">Edit My Profile</a></li>
</ul>
</li>
<!-- new menu here edit the links-->
<li class="menu-item"id="menu-item-22"> <a href="http://maolalumnet.org/members/">All Members</a>
<ul class="sub-menu">
<li class="menu-item"> </li>
</ul>
</li>
<!--end menu--->
<!-- new menu here edit the links-->
<li class="menu-item"id="menu-item-22"> <a href="http://maolalumnet.org/groups/">All Groups</a>
<ul class="sub-menu">
<li class="menu-item"> <a href="<?php echo bp_loggedin_user_domain() ?>groups/">My Groups</a></li>
</ul>
</li>
<!--end menu--->
<!-- new menu here edit the links-->
<li class="menu-item"id="menu-item-22"> <a href="http://maolalumnet.org/events/">All Events</a>
<ul class="sub-menu">
<li class="menu-item"> <a href="http://maolalumnet.org/events-calander/">Calendar View</a></li>
<li class="menu-item"> <a href="<?php echo bp_loggedin_user_domain() ?>events/my-events/">My Events</a></li>
<li class="menu-item"> <a href="<?php echo bp_loggedin_user_domain() ?>events/my-events/">Create an Event</a></li>
</ul>
</li>
<!--end menu--->
<?php ;} ?>
I forgot to add this is for BUDDYPRESS
This worked:
Add to functions.php:
Add to header.php before
</header>
And the original code has been slightly altered to this: