Support » Themes and Templates » How to highlight current menu items

  • Hi!

    I just started WordPress and I’d like to enhance current menu items. Ive tokena look on every posts about about that but im still stuck. So here is my php code forthe menu ( I have submenu):

    <div class="menu">
    
    			<?php wp_nav_menu(array(
    			'theme_location' => 'nav',
    			'menu' => 'header',
    			'depth'=> 1,
    			)
    			); ?>
    </div>		
    
    <div class="submenu">
    <ul><li> <a>
    <?php
      if($post->post_parent)
      $children = wp_list_pages("title_li=&child_of=".$post->post_parent."&echo=0");
      else
      $children = wp_list_pages("title_li=&child_of=".$post->ID."&echo=0");
    
      echo $children;
     ?>
    </a> </li> </ul> </div>

    and here is the class I want for current menu items :

    .menu ul li .selected {
    	color: #336699;
    	border-left: 1px dotted #999999;
    } 
    
    .submenu ul li .selected {
    	color: #336699;
    	border-left: 1px dotted #999999;
    }

    Could someone help me with that?

    Thank you very much

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to highlight current menu items’ is closed to new replies.