Quick question about the behavior of the wp_nav_menu function. The codex says :
Given a theme_location parameter, the function displays the menu assigned to that location, or nothing if no such location exists or no menu is assigned to it.
If not given a theme_location parameter, the function displays
* the menu matching the ID, slug, or name given by the menu parameter, if that menu has at least 1 item;
* etc.
In my experiments however, “menu” seems to be taking precedence over “theme_location” if both are declared. The following code outputs the “Primary Navigation” menu as defined via the admin panel, not the menu actually associated with the registered “footer_menu” location in said panel.
As a matter of fact, it doesn’t seem to do so. On the contrary : the “menu” parameter seems to override the “theme_location” parameter when both are declared. See my example above.
Am I not seeing the elephant in the room or is there indeed some inconsistency in the Codex ?
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘wp_nav_menu : theme_location vs. menu parameters’ is closed to new replies.