Slight nav highlighting problem
-
BACKGROUND INFO: I have a static Page set as the Front Page, and a Page called “Rambles” is set as the Posts Page, which pulls posts from the category “Rambles”. I have another Page called “Visuals” which pull Posts from a category called “Visuals”.
THE ISSUE: When you click on Rambles in the nav, Visuals is highlighted, and vice versa.
THE SITE in-progress: http://wp.deanlavenson.com
THE CODE that I’m trying to make work:
<ul class="mainnav"> <li<?php if ( is_front_page() ) {?> class="current"<?php }?>><a href="/">Home</a></li> <li<?php $ancestors = get_post_ancestors($post); if ( in_array(2,$ancestors) || is_page('about') ) {?> class="current"<?php }?>><a href="/about/">About</a></li> <li<?php if ( in_category(3) || is_page('Visuals') ) {?> class="current"<?php }?>><a href="/visuals/">Visuals</a></li> <li<?php if ( !is_front_page() && in_category(1) || is_home() ) {?> class="current"<?php }?>><a href="/rambles/">Rambles<strong>*</strong></a></li> </ul>Any idea what’s causing this?
The topic ‘Slight nav highlighting problem’ is closed to new replies.