Created
January 26, 2017 16:59
-
-
Save luizbills/dbbe524e5dd735c685061f34c6c5806a to your computer and use it in GitHub Desktop.
Show different menu in wordpress
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'wp_nav_menu_args', 'custom_change_primary_menu' ); | |
function custom_change_primary_menu ( $args ) { | |
if ( $args['theme_location'] === 'primary' ) { | |
$args['menu'] = 'Menu 2'; | |
} | |
return $args; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment