Conditional Menu
-
Hi,
Long time user of this wonderful theme! I have created a page with a vertical header and added a menu ‘A’ to it. I am trying to change the menu on this page to menu ‘B’ through a function. Menu B is the main menu.
add_action('wp', 'page_check'); function page_check() { if (is_page('about')) { wp_nav_menu( array( 'theme_location' => 'main_menu') ); } }
I have placed this code in functions.php, but menu ‘A’ isn’t changing to menu ‘B’
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Conditional Menu’ is closed to new replies.