WordPress.org

Ready to get started?Download WordPress

Forums

dynamic menu showing multiple "current" (2 posts)

  1. hazniet
    Member
    Posted 7 years ago #

    I have my dynamic menus working, they are just working too well. My link structure is: home, category, category, etc.

    At the home page the home link is highlighted, great. The problem is that the category of the most recent post is also highlighted. I'm not sure why it is doing this. This problem only occurs on the home page. Here is my code for the links:

    <!-- To show "current" on the home page -->
    <li<?php if (is_home()) { echo " class=\"current\""; }?>>
    <a href="<?php bloginfo('url') ?>/">Home</a>
    </li>
    
    <!-- To show "current" on any posts in category 10, called Adjudications -->
    <li<?php if (is_category('adjudications') || in_category('10') && !is_single()) { echo " class=\"current\""; }?>>
    <a href="<?php bloginfo('url') ?>/adjudications">Adjudications</a>
    </li>
  2. hazniet
    Member
    Posted 6 years ago #

    anyone?

Topic Closed

This topic has been closed to new replies.

About this Topic