• Hi,

    i have two menus in my dashboard: the main one, which shows at “primary” and a second one, managed by the theme CSS, which displays the social media icons.

    Well, i would like to replicate the secondary (social media) menu at the beginning of the header as well: if i’m not wrong, i have to create a new menu location (which i don’t have in my dashboard), but in WP documentation i found how to create both menu and location together.

    How can i just call the secondary menu without re-creating it? (theme’s CSS intercepts the name of the 2nd menu and restyles it as icons instead of text)

    Thanks!

    • This topic was modified 4 years, 10 months ago by Jan Dembowski. Reason: Moved to Fixing WordPress, this is not an Developing with WordPress topic
Viewing 4 replies - 1 through 4 (of 4 total)
  • When a theme calls wp_nav_menu, one of the parameters is theme_location. You can (in a child theme) copy the PHP code for the secondary menu wp_nav_menu call, but put it in a different place, and it will work like you want. The theme_location can be output multiple times, but it is simply a way to associate the menu the user creates with where the theme will output it. If you keep the parameters and container markup the same, you will get the same output. But if one of the parameters is container_id, then you need to change it, since IDs need to be unique in a page. Hopefully, the styling is not based on the ID, but on classes.

    Thread Starter MirkoB82

    (@mirkob82)

    hi Joy, thanks for your reply. About the topic, yes: i noticed the theme_location parameter. anyways, where i can find the code for the secondary menu to be put in the child theme? could you paste it, please? thank you! (sorry, i just started customizing themes).

    ps: another question: what if the theme (or in my case a plugin) already has a menu and i want it to be just inserted in another place in the page? how the code changes?

    in my example, siteorigin toolbox uses a “social Media Menu” formatted with icons, and it’s recalled via widgets in siteorigin pagebuilder or footer widgets.. i want it to show in page header instead.

    • This reply was modified 4 years, 9 months ago by MirkoB82.

    You have to look in your theme to find the wp_nav_menu call and copy it to the place where you want the new one.

    If it doesn’t come from your theme but a plugin, then you have a question about a plugin’s menu, you need to ask at the plugin’s support forum.

    Thread Starter MirkoB82

    (@mirkob82)

    ok thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘creating just nav menu location? (not menu)’ is closed to new replies.