Custom format nav menu only using div and a

Below is a walker class that will do just that. Add this to your functions.php file; class Description_Walker extends Walker_Nav_Menu { function start_el(&$output, $item, $depth, $args) { $classes = empty($item->classes) ? array () : (array) $item->classes; $class_names = join(‘ ‘, apply_filters( ‘nav_menu_css_class’, array_filter( $classes ), $item ) ); !empty ( $class_names ) and $class_names=” class=””. … Read more

Highlight current post ancestor parent menu items

This is probably what you are looking for .. add_filter( ‘wp_nav_menu_objects’, ‘add_menu_parent_class’ ); function add_menu_parent_class( $items ) { $parents = array(); foreach ( $items as $item ) { if ( in_array(‘current-post-ancestor’, $item->classes) ) { $parents[] = $item->menu_item_parent; } } foreach ( $items as $item ) { if ( in_array( $item->ID, $parents ) ) { $item->classes[] … Read more

wordpress responsive menu not dropping down

It sounds like the click event is being bound to your .menu-toggle button more than once. One possible fix is to unbind the click event first, but this is not ideal: $(‘.menu-toggle’).unbind(‘click’).click(function () {… https://stackoverflow.com/questions/3829871/slidetoggle-executing-twice-in-one-call A better solution would be to try and work out how the click event could be added twice? Also, it … Read more

Put class on instead li

If you use your custom Walker class, then there’s no point in using filters for adding these classes. Let’s take a look at this part of your code: $class_names = join( ‘ ‘, apply_filters( ‘nav_menu_css_class’, array_filter( $classes ), $item, $args ) ); $class_names = $class_names ? ‘ class=”‘ . esc_attr( $class_names ) . ‘”‘ : … Read more