1
2
3
4
5
6
7
8
9
10
11
12
// filer wp_nav_menu_args to add the custom walker to wp_nav_menu(), used by genesis_do_nav()
add_filter( 'wp_nav_menu_args', 'my_navigation_walker' );
 
function my_navigation_walker ( $args ){
    if( isset( $args['menu_class'] ) && 'menu genesis-nav-menu menu-primary' === $args['menu_class'] ) {
	if( class_exists( 'My_Navigation' ) ) {
		$args['walker'] = new My_Navigation(); 
	}
    }
 
    return $args;
 }

Source found here

Add Walker_Nav_Menu extension with Genesis
Tagged on:     

Leave a Reply

Your email address will not be published. Required fields are marked *