January 23, 2017
Change WordPress menu on each page
Description:
Kind:
PHP, Beaver
HTML:
https://www.youtube.com/watch?v=XGgwetd_yTI
PHP:
// Conditionally change menus add_filter( 'wp_nav_menu_args', 'bb_wp_nav_menu_args' ); function bb_wp_nav_menu_args( $args = '' ) { // change the menu in the Header menu position if( $args['theme_location'] == 'header' && is_page('1159') ) { $args['menu'] = '32'; // 32 is the ID of the menu we want to use here } return $args; }