Title: Problem with menu .active
Last modified: August 21, 2016

---

# Problem with menu .active

 *  [DesignSolutions.pl](https://wordpress.org/support/users/designsolutions/)
 * (@designsolutions)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/problem-with-menu-active/)
 * Hi,
    I have problem with top menu on site [http://www.poludniak.com/index.php/ilustracje/logo-i-design/](http://www.poludniak.com/index.php/ilustracje/logo-i-design/)
 * I want to have menu item active when we are on page, also should be menu item
   active in bottom menu fx. when we are on page “logo-i-design” on top menu should
   it be active and in bottom menu should be active “ilustracje”.
 * Can anybody help?
    Thanks 🙂

Viewing 6 replies - 1 through 6 (of 6 total)

 *  [Riversatile](https://wordpress.org/support/users/riversatile/)
 * (@riversatile)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/problem-with-menu-active/#post-4315829)
 * Hi Designsolutions,
 * I saw there is a problem in the source code of your page…
    You should have the
   CSS class “current-menu-item” on the “li” element for the displayed menu item.
   But it’s not the case. I don’t know how to do this. Sorry.
 *  Thread Starter [DesignSolutions.pl](https://wordpress.org/support/users/designsolutions/)
 * (@designsolutions)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/problem-with-menu-active/#post-4315832)
 * Thanks riversatile for your reply. I tryed a lot of solutions to resolve it but
   nothing works. I tryed also with “current-menu-item” and it not works. Maybe 
   I make something wrong or there is some harder problem in WordPress I think…
 *  [Riversatile](https://wordpress.org/support/users/riversatile/)
 * (@riversatile)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/problem-with-menu-active/#post-4315860)
 * When I put “current-menu-item” in the Class of your current menu “li” element,
   the menu is highlighted correctly !
    The inner “a” element CSS style is : **background:#
   d64387;**
 * See the demo here: [http://postimg.org/image/j3gncf193/](http://postimg.org/image/j3gncf193/)
 * So the only thing to solve is to know why the Class “current-menu-item” doesn’t
   show up.
 *  Thread Starter [DesignSolutions.pl](https://wordpress.org/support/users/designsolutions/)
 * (@designsolutions)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/problem-with-menu-active/#post-4315875)
 * Yes, you`ve got true. But how to change class for li? Navigation is put in php
   as:
 * <div class=”navigation”>
    -  <?php wp_nav_menu(array(‘menu’ => ‘il’)); ?>
 * </div>
 * Can I set here class current-menu-item or something?
 *  [Riversatile](https://wordpress.org/support/users/riversatile/)
 * (@riversatile)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/problem-with-menu-active/#post-4315906)
 * Yes, you have to add something in the PHP code.
    Here is what I found on [THIS TOPIC](http://stackoverflow.com/questions/9265902/how-to-keep-the-highlight-of-an-item-menu).
   It may help.
 * > If you’re using PHP you could use a variable to indicate wheter the page is
   > active.
   >     ```
   >     <div id="main-menu">
   >                 <ul div="nav">
   >                     <li><a <?php echo $isactive; ?> href="about.html" target="_blank">ABOUT</a></li>
   >                     <li><a <?php echo $isactive; ?> href="services.html" target="_blank">SERVICES</a></li>
   >                     <li><a <?php echo $isactive; ?> href="portfolio.html" target="_blank">PORTFOLIO</a></li>
   >                     <li><a <?php echo $isactive; ?> href="blog.html" target="_blank">BLOG</a></li>
   >                     <li><a <?php echo $isactive; ?> href="contact.html" target="_blank">CONTACT</a></li>
   >                 </ul>
   >     Then if the page is active you could print something like "class='active_section'" and in your css:
   > 
   >     .active_section {
   >     color: #CE1F20;
   >     text-decoration: none;
   >     }
   >     ```
   > 
 * You just have to adapt the Class in function of your Class name (“current-menu-
   item”)
 *  Thread Starter [DesignSolutions.pl](https://wordpress.org/support/users/designsolutions/)
 * (@designsolutions)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/problem-with-menu-active/#post-4315954)
 * Thanks for your reply 😉
    I tryed it and also doesn`t work. I`m out of my mind
   with this case ;/

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Problem with menu .active’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 6 replies
 * 2 participants
 * Last reply from: [DesignSolutions.pl](https://wordpress.org/support/users/designsolutions/)
 * Last activity: [12 years, 6 months ago](https://wordpress.org/support/topic/problem-with-menu-active/#post-4315954)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
