• Hi,

    I currently have a basic navigation for a site which highlights the current page as follows:

    <ul id="nav" role="navigation">
    
    <li<?php if ( is_page('home')  ) { echo ' class="current"'; } ?>><a href="/">Home</a></li>
    <li<?php if ( is_page('about') ) { echo ' class="current"'; } ?>><a href="/about/">About</a></li>
    <li<?php if ( is_page('work') ) { echo ' class="current"'; } ?>><a href="/work/">Work</a></li>
    <li<?php if ( is_page('blog') ) { echo ' class="current"'; } ?>><a href="/blog/">Blog</a></li>
    <li<?php if ( is_page('contact') ) { echo ' class="current"'; } ?>><a href="/contact/">Contact</a></li>
    </ul>

    However when i’m in archives i’d still like the link to the blog section to be highlighted. Is it possible to add a condition or an array to the above?

    `<ul id=”nav” role=”navigation”>

    • Home
    • About
    • Work
    • <li class=”current”>Blog

    • Contact
    • Basically looking for the above to be generated when i’m viewing archies.

      Tia

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Highlighting Archives in main Nav using is_page’ is closed to new replies.