php - How to insert secondary menu on TwentyThirteen theme in WordPress?
Get the solution ↓↓↓I am currently using Twenty Thirteen theme and I want to create a secondary menus. I am not entirely familiar with the PHP codes. I was wondering if you know how to insert the proper code in function.php? Also, do you know the code to insert in header.php page?
Here is the example of codes from Twenty Eleven theme:
register_nav_menus( array(
'primary' => __( 'Primary Menu', 'yourtheme'),
'secondary' => __( 'Secondary Menu', 'yourtheme' ),
) );
<nav>
<?php
wp_nav_menu( array('container_class' => 'menu-footer',
'theme_location' => 'secondary') ); ?>
</nav>
Thanks!
Answer
Solution:
by secondary menu, i assume you mean a sub menu? this is done in the wordpress cms. first create the pages, then go to the menu module and add them to the primary menu you have already set up. then they will appear with when you call the menu. you will have to stylize them in css to get them to be a nav bar and there are tons of tutorials and already answered questions on that.
if you are creating a second separate menu, then you are on exactly the right track with registering the menus. but then you want to call them with the wp_nav_menu() in different places, unless you want to join the menus, which you can do by placing<ul></ul>
around the php code.
always actually create the pages and menu wordpress and once you register it, be sure to go back in to the menu and link the menu to the location under the manage location tab. check codex if you don't know what i mean. you may have forgotten that step. good luck!
Share solution ↓
Additional Information:
Link To Answer People are also looking for solutions of the problem: please make sure the php redis extension is installed and enabled.
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.