Solved

How do I add a second menu next to the main menu in a Wordpress theme?

Posted on 2014-12-27
5
130 Views
Last Modified: 2014-12-28
I have a site here:

http://rentawebguy.com/jen/

which is a Wordpress theme.  It currently has one menu in the header that is on the right side below the logo.

I need a second menu on the left side and then both menus positioned on either side of the logo.

Attached is a graphic showing what I want it to look like.

Any help is appreciated.
header.png
0
Comment
Question by:Donnie Walker
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 70

Expert Comment

by:Jason C. Levine
ID: 40519914
You have to be comfortable working with the PHP side of WordPress.  Are you?
0
 

Author Comment

by:Donnie Walker
ID: 40519937
enough to be dangerous.
0
 
LVL 70

Accepted Solution

by:
Jason C. Levine earned 500 total points
ID: 40520164
So the instructions on how to do this are found in this Codex article:

http://codex.wordpress.org/Navigation_Menus#Register_Menus

To paraphrase (aka copy/paste shamelessly), somewhere in your current functions.php file you have some code that looks like this:

function register_my_menu() {
  register_nav_menu('header-menu',__( 'Header Menu' ));
}
add_action( 'init', 'register_my_menu' );

Open in new window


What you need to do is alter that to make it look like this:

function register_my_menus() {
  register_nav_menus(
    array(
      'header-menu' => __( 'Header Menu' ),
      'extra-menu' => __( 'Extra Menu' )
    )
  );
}
add_action( 'init', 'register_my_menus' );

Open in new window


That change will define an extra custom menu in your theme.  Build the menu in Appearance | Menus the normal way.  Then, in your header.php file you have something that looks like this:

<?php wp_nav_menu( array( 'theme_location' => 'header-menu' ) ); ?>

Open in new window


You would place this code (or a variant of it) on the other side of the logo:

<?php wp_nav_menu( array( 'theme_location' => 'extra-menu' ) ); ?>

Open in new window


The Codex article talks about how to how better to use wp_nav_menu so you can assign different container classes to each menu to make sure you get the floats the way you want them.

You may also want to read:

http://justintadlock.com/archives/2010/06/01/goodbye-headaches-hello-menus
0
 
LVL 29

Expert Comment

by:chilternPC
ID: 40520324
a couple of thoughts -
- it looks like you are using a theme called 'Make'  from theme foundry  which has a 'drag and drop page builder'  and maybe they have a way  of  placing the main menu and the custom menu widget in the header in the way you want?
- Web use is really switching over to smart devices/tablets where the screen is a lot smaller and  the 2 menus ether side of the logo would be only seen on a large screen
0
 

Author Closing Comment

by:Donnie Walker
ID: 40520457
Thanks Jason! That really helped.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction A frequently asked question goes something like this:  "I am running a long process in the background and I want to alert my client when the process finishes.  How can I send a message to the browser?"  Unfortunately, the short answer…
This article shows the steps required to install WordPress on Azure. Web Apps, Mobile Apps, API Apps, or Functions, in Azure all these run in an App Service plan. WordPress is no exception and requires an App Service Plan and Database to install
The purpose of this video is to demonstrate how to add AdSense Ads to a WordPress Website, and how to set up WordPress to automatically place Ads in Sidebars. This will be demonstrated using a Windows 8 PC. Log into your AdSense account. : Cli…
The purpose of this video is to demonstrate how to Test the speed of a WordPress Website. Site Speed is an important metric of a site’s health. Slow site speed can result in viewers leaving your site quickly and not seeing your content. This…

696 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question