How to replace the standard menu for specific page types

I would like to add a new menu to specific pages of the theme.
Specifically, my website has quizzes for students.
I don't want the standard menu to show when the students are taking a quiz.

I have determined that in order to do this I need to:
0) Create a new template for the new page type (in my case, a quiz page).
1) Register a new menu type using register_nav_menu("new-menu-type",__( "Readable Name")) to function.php in the theme folder.
2) Create a new "theme location" by adding wp_nav_menu(array( 'theme_location' => 'new-menu-type' )) to the header of a template file.
3) Then use the admin-panel Appearance > Menus, create the new menu and assign it to the new menu type.

As you can imagine, my difficulty is in step 2.  I can add an extra menu, but I can't remove the existing one.
I would really appreciate some guidance in this regard.  Thanks

Comments

  • Hi,

    we are really sorry but we do not offer files customizations and that's why in this matter we can not help you unfortunately.

    Thanks for understanding!
  • I don't understand.  What do you mean by "files customizations"?  I am not asking for a customization, I am asking a "how to" question.
  • edited September 2015
    We know what you ask for. In this case "how to" means that you must modify theme files. Without theme files modifications it just won't be possible. Such possibility is not included unfortunately.
  • Are you saying that there is no way to create a page with no menu?  This is hard to believe.
  • We did not said that. It's possible of course if you know coding and you know how to do it. Then everything is possible We just say that we do not offer that kind of customizations. If you want, we can only tell you how to hide menu with custom css. So you create regular pages and remove menu with custom css. Or if you don't need a footer as well, then you can use "Blank" template.
  • I am comfortable with coding.  I am not asking for a customization.  All I really want to know is: which file contains the call to wp_nav_menu.  I can handle it from there.  Thanks.
  • wp_nav_menu() is default wp function and is called under theme-menu.php file.
Sign In or Register to comment.
This website uses cookies

We use cookies to personalise content and ads, to provide social media features and to analyse our traffic. We also share information about your use of our site with our social media, advertising and analytics partners who may combine it with other information that you’ve provided to them or that they’ve collected from your use of their services.

Cookies are small text files that can be used by websites to make a user's experience more efficient.

The law states that we can store cookies on your device if they are strictly necessary for the operation of this site. For all other types of cookies we need your permission. This means that cookies which are categorized as necessary, are processed based on GDPR Art. 6 (1) (f). All other cookies, meaning those from the categories preferences and marketing, are processed based on GDPR Art. 6 (1) (a) GDPR.

This site uses different types of cookies. Some cookies are placed by third party services that appear on our pages.

You can at any time change or withdraw your consent from the Cookie Declaration on our website.

Learn more about who we are, how you can contact us and how we process personal data in our Privacy Policy.

Please state your consent ID and date when you contact us regarding your consent.