Last active
December 14, 2015 22:58
-
-
Save SideQuestDIY/5161892 to your computer and use it in GitHub Desktop.
A quick explanation of how to use the WordPress wp_nav_menu's fallback_cb variable.
This file contains hidden or 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 | |
wp_nav_menu( array( | |
'menu' => 'top_menu', | |
'depth' => 2, | |
'container' => false, | |
'menu_class' => 'nav', | |
//Process nav menu using our custom nav walker | |
'walker' => new twitter_bootstrap_nav_walker()), | |
'fallback_cb' => 'wp_page_menu', // No menu available: will display all pages in menu | |
//'fallback_cb' => '__return_false', // No menu available: no output. | |
); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I think the 'fallback_cb' must be set inside the array, the code above is set outside array, look
Thanks :)