Support » Themes and Templates » Dynamic Highlighting & is_archive problem

  • Resolved markmichon

    (@markmichon)


    I am looking for another set of eyes on this. For whatever reason the archive portion of this is not working. Home works fine, about works fine, but archive just won’t accept the new id.

    <li><a class="navhome" <?php if(is_home()) echo 'id="current"' ;?> href="<? bloginfo('url') ?>">Home</a></li>
    <li><a class="navarchives" <?php if(is_archive() ) echo 'id="current"' ;?> href="<? bloginfo('url') ?>/archives/">Archives</a></li>
    <li><a class="navabout" <?php if(is_page('About') ) echo 'id="current"' ;?> href="<? bloginfo('url') ?>/about/">About</a></li>

    I’ve tried using is_page(‘archives’) and that doesn’t work either. I can copy paste the about code and have it work, but only on the about page.

    I am running this through xampp so can’t link to it at the moment.

    Thanks in advance.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter markmichon

    (@markmichon)

    Bumping the thread. I should also note that for some reason the archives page is putting the current style onto the home page. It’s something to do with the php, as a view source indicates it is never added to the second list item.

    Thread Starter markmichon

    (@markmichon)

    Another bump to see if any of the evening crowd has an idea.

    Thread Starter markmichon

    (@markmichon)

    Well, if anyone in the future is interested. The reason I was having the problem is somehow related to placing your nav in the footer(sounds odd, but long story). For some reason, the way WP loads the footer doesn’t like the method of dynamic highlighting and works on some pages but not others. I’ve no idea why, but moving my nav to the header and using positioning to get it where I wanted solved the problem.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Dynamic Highlighting & is_archive problem’ is closed to new replies.