I have this code that generates a WP menu:
<div id="menu">
<?php $args = array(
'depth' => 1,
'show_date' => '',
'date_format' => get_option('date_format'),
'child_of' => 0,
'exclude' => '426, 508',
'include' => '',
'title_li' => __(''),
'echo' => 1,
'authors' => '',
'sort_column' => 'menu_order, post_title',
'link_before' => '',
'link_after' => '',
'walker' => '' ); ?>
<ul><div class="menu-button"><?php wp_list_pages( $args, 'sort_column=menu_order' ); ?></div></ul>
</div>
I have some CSS to to the hover states of the menu items but is it possible to show an “on” state so if the user is on that actual page, the menu item is a different color?
Source: codex.wordpress.org/Function_Reference/wp_list_pages#Markup_and_styling_of_page_items
So if you set a CSS rule for
.current_page_item
, you can style the current page’s list style in your navigation.I’m not too clued up on wordpress but hopefully their codex shall cover it all http://codex.wordpress.org/Function_Reference/wp_nav_menu. Is it a must that the menu is generated dynamically or could you hard code it?