Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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

1 Answer 1

check 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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.