WordPress.org

Ready to get started?Download WordPress

Forums

current menu item in wp_nav_menu (4 posts)

  1. linda@geckowebb.se
    Member
    Posted 2 years ago #

    Hi!
    I want to highlight the current menu item in my menu. I am stuck.

    In header.php:

    <?php
    			wp_nav_menu(array(
    			'theme_location' => 'main',
    			 'container_id' => 'navigation'
    			));
    		?>

    in functions.php

    if(function_exists('register_nav_menus')){
    		//register_nav_menus(array('main-menu' => 'Main Navigation'));
    		register_nav_menus(array(
    		'main' => 'Navigation',
    		'footer' => 'Footer Menu'));
    	}

    How do I continue? :)
    Tips and trix are hugely appreciated!

  2. esmi
    Forum Moderator
    Posted 2 years ago #

    Try using Firefox with the Firebug add-on for this kind of CSS work.
    http://getfirebug.com/

  3. linda@geckowebb.se
    Member
    Posted 2 years ago #

    hmmmmm....but how do I get the current_menu_item at the first place?
    Then I´ll do the styling :)

  4. esmi
    Forum Moderator
    Posted 2 years ago #

    wp_nav_menu() adds this class automatically.

Topic Closed

This topic has been closed to new replies.

About this Topic