• I have my site set up to use a static front page.
    My blog posts display on another page.

    I use the regular code for active menu highlighting but can’t get it to work when the ‘blog’ is not the home page.

    For an example of 4 menu items…

    <li class="home"><a<?php if(is_front_page('home')) echo ' class="active"';?> href="/new"></a></li>
          <li class="news"><a<?php if(is_page('news')) echo ' class="active"';?> href="/new/news/"></a></li>
          <li class="releases"><a<?php if(is_page('releases')) echo ' class="active"';?> href="/new/releases/"></a></li>
          <li class="labels"><a<?php if(is_page('labels')) echo ' class="active"';?> href="/new/labels/"></a></li>

    How do I get the NEWS menu item to stay highlighted when I am in the NEWS section (my regular blog posts) now that my site is set to use this section as my blog (because my HOME is a static front page)?

    Any ideas welcome!

Viewing 1 replies (of 1 total)
  • Thread Starter lowercase001

    (@lowercase001)

    and the answer is…

    <li class="home"><a<?php if(is_front_page('home')) echo ' class="active"';?> href="/new"></a></li>
          <li class="news"><a<?php if(is_home('news')) echo ' class="active"';?> href="/new/news/"></a></li>
          <li class="releases"><a<?php if(is_page('releases')) echo ' class="active"';?> href="/new/releases/"></a></li>
          <li class="labels"><a<?php if(is_page('labels')) echo ' class="active"';?> href="/new/labels/"></a></li>
Viewing 1 replies (of 1 total)
  • The topic ‘Active menu highlighting for site using static front page’ is closed to new replies.