By default if a user has not created say a footer or a top level menu then WordPress, in the case of the footer, will use default content like pages and so on to "create" a menu.
I don't want this to happen. I want to do something like:
if user has not set a menu for footer
display a message telling them they should.
else
display said menu.
end
How would I do this?
By default if a user has not created say a footer or a top level menu then WordPress, in the case of the footer, will use default content like pages and so on to "create" a menu.
I don't want this to happen. I want to do something like:
if user has not set a menu for footer
display a message telling them they should.
else
display said menu.
end
How would I do this?
Share Improve this question asked Jun 4, 2013 at 22:45 TheWebsTheWebs 1,1053 gold badges19 silver badges30 bronze badges1 Answer
Reset to default 1check in footer if their any menu for their location
<?php
if ( has_nav_menu( $location ) ) {
//add your footer menu or do something
}else{
//display a message telling them they should
}
?>
Important Link:
has_menu_nav