Is there a way to set the following option from a WordPress plugin, if you know the name of the menu you want to set:
My developer says it’s not possible, but I am sure on of you gurus knows a way around this 😉
Is there a way to set the following option from a WordPress plugin, if you know the name of the menu you want to set:
My developer says it’s not possible, but I am sure on of you gurus knows a way around this 😉
Comments are closed.
You can use the
wp_nav_menu_args
filter ( Codex reference ) to set a theme location to use a specific menu.Example:
You can use
get_theme_mod
andset_theme_mod
to save nav menu locations.Get locations:
prints:
Get existing nav menus:
prints:
Set location: