Top Menu (Secondary Menu) Not Displaying

I am creating a website on a localhost on my computer using Sydney and Sydney Child themes. I am thinking of upgrading to Sydney Pro but have a concern about the menus.

I need to add a second menu in the top bar above the main menu. I want to separate the links for people that need to register and/or log into their online accounts to access their training materials.

I have created the primary (Main Menu) and top menu (Secondary Menu) in the menus section of WordPress. The primary menu is appearing as normal but I cannot get the top menu to display.

So you registered a new menu location by adding this code into the Sydney Child’s functions.php file?


register_nav_menus( array(
   'secondary' => __( 'Secondary Menu', 'sydney' ),
) );

Please confirm.

Regards,
Kharis

I had some similar CSS code that I had found in a forum post.

I removed the code I has used and inserted your code into the Sydney Child function.php file and it still did not show the top (second menu).

I looked at the function.php file for the Sydney theme and found this same CSS code

// This theme uses wp_nav_menu() in one location.
register_nav_menus( array(
‘primary’ => ( ‘Primary Menu’, ‘sydney’ ),
) );
register_nav_menus( array(
‘secondary’ =>
(‘Secondary Menu’,‘sydney’),
//similaryly add as much as you want
) );

Appreciate any help in getting the second menu to display.I have been trying to fix this for a couple of days.

Hello there,

To display your new menu, copy the header.php file from parent theme to child theme. Insert this code:


<?php wp_nav_menu( array( 'theme_location' => 'secondary' ) ); ?>

after this code:


<div class="header-wrap">
        <div class="container">

To adjust its look, you will need to add a couple of CSS code.

Regards,
Kharis

Hi Kharis,

I followed your instructions but still I cannot see the second menu displayed at the top of the website page.

I added the above code at the bottom of the header.php file. Would it matter where I place it in the file?

Here is the code from the header.php file:

<?php
/**

  • The header for our theme.
  • Displays all of the <head> section and everything up till <div id=“content”>
  • @package Sydney
    */
    ?><!DOCTYPE html>
    <html <?php language_attributes(); ?>>
    <head>
    <meta charset="<?php bloginfo( ‘charset’ ); ?>">
    <meta name=“viewport” content=“width=device-width, initial-scale=1”>
    <link rel=“profile” href=“http://gmpg.org/xfn/11”>
    <link rel=“pingback” href="<?php bloginfo( ‘pingback_url’ ); ?>">
    <?php if ( ! function_exists( ‘has_site_icon’ ) || ! has_site_icon() ) : ?>
    <?php if ( get_theme_mod(‘site_favicon’) ) : ?>
    <link rel=“shortcut icon” href="<?php echo esc_url(get_theme_mod(‘site_favicon’)); ?>" />
    <?php endif; ?>
    <?php endif; ?>

<?php wp_head(); ?>
</head>

<body <?php body_class(); ?>>
<div class=“preloader”>
<div class=“spinner”>
<div class=“pre-bounce1”></div>
<div class=“pre-bounce2”></div>
</div>
</div>
<div id=“page” class=“hfeed site”>
<?php _e( ‘Skip to content’, ‘sydney’ ); ?>

&lt;header id="masthead" class="site-header" role="banner"&gt;
	&lt;div class="header-wrap"&gt;
        &lt;div class="container"&gt;
            &lt;div class="row"&gt;
			&lt;div class="col-md-4 col-sm-8 col-xs-12"&gt;
	        &lt;?php if ( get_theme_mod('site_logo') ) : ?&gt;
				<a>" title="&lt;?php bloginfo('name'); ?&gt;"&gt;<img />" alt="&lt;?php bloginfo('name'); ?&gt;" /&gt;</a>
	        &lt;?php else : ?&gt;
				&lt;h1 class="site-title"&gt;<a>" rel="home"&gt;&lt;?php bloginfo( 'name' ); ?&gt;</a>&lt;/h1&gt;
				&lt;h2 class="site-description"&gt;&lt;?php bloginfo( 'description' ); ?&gt;&lt;/h2&gt;	        
	        &lt;?php endif; ?&gt;
			&lt;/div&gt;
			&lt;div class="col-md-8 col-sm-4 col-xs-12"&gt;
				&lt;div class="btn-menu"&gt;&lt;/div&gt;
				&lt;nav id="mainnav" class="mainnav" role="navigation"&gt;
					&lt;?php wp_nav_menu( array( 'theme_location' =&gt; 'primary', 'fallback_cb' =&gt; 'sydney_menu_fallback' ) ); ?&gt;
				&lt;/nav&gt;&lt;!-- #site-navigation --&gt;
			&lt;/div&gt;
			&lt;/div&gt;
		&lt;/div&gt;
	&lt;/div&gt;
&lt;/header&gt;&lt;!-- #masthead --&gt;
&lt;?php sydney_slider_template(); ?&gt;

&lt;div class="header-image"&gt;
	&lt;?php sydney_header_overlay(); ?&gt;
	<img />" width="&lt;?php echo esc_attr( get_custom_header()-&gt;width ); ?&gt;" alt="&lt;?php bloginfo('name'); ?&gt;"&gt;
&lt;/div&gt;

&lt;div id="content" class="page-wrap"&gt;
	&lt;div class="container content-wrapper"&gt;
		&lt;div class="row"&gt;

<?php wp_nav_menu( array( ‘theme_location’ => ‘secondary’ ) ); ?> <div class=“header-wrap”> <div class=“container”>

I have got the second menu to display now but it is below the slider. How do I get it to move up to the top of the page above the main menu?

I noticed that the second menu is appearing at the top of all pages and posts.

The second menu items are stacked and not inline across the page or post.

How do I get the menu to be inline and in the header above the main menu?

Hello there,

Please share the link to your site, so I can take a closer look.

Regards,
Kharis

Hi Kharis,

I migrated my localhost website to a test site on my hosting server. Here is the link:

http://sydney.leanmanufacturingway.com/

You will see the second menu that I am trying to get to the top of the page in red font below the slider and above the content.

I appreciate any help you can give me with this issue.

Hello there,

Please edit the header.php file of child theme. Then find this line:

<header id="masthead" class="site-header" role="banner">
	<div class="header-wrap">
          <div class="container">

Move this code:


<?php wp_nav_menu( array( 'theme_location' => 'secondary' ) ); ?>

right after DIV.container line.

Regards,
Kharis

Thank you for the updated information. I followed your instructions and they did move the second menu into the top of the page above the main menu. The problem is the second menu is stacked and not inline and it’s over on the left of the page above the site logo. I would prefer it to be over on the right side and above the main menu.

Hello there,

Please find this line:


<div class="col-md-8 col-sm-4 col-xs-12">

then move the code after it.

Regards,
Kharis

I tried moving the code in the header.php file of the child theme as you instructed but it did not change anything. The secondary menu was still displayed below the slider and header.

I decided to try something else so I copied the code for the main navigation menu and changed some of the code to call the secondary menu.

</div>
<div class=“col-md-4 col-sm-8 col-xs-12”>
<div class=“btn-menu”></div>
<nav id=“menu-secondary” class=“menu-secondary” role=“navigation”>
<?php wp_nav_menu( array( ‘theme_location’ => ‘secondary’, ‘fallback_cb’ => ‘sydney_menu_fallback’ ) ); ?>
</nav><!-- #site-navigation -->
</div>

Here is the website link:
http://sydney.leanmanufacturingway.com/

I finally have the menu displaying at the top of the page but the links are stacked and not inline. I want it to appear the same as the main navigation menu (inline). The secondary menu links are behind the header overlay so I cannot click them.

I also want the top menu (secondary menu) to be on the right, not the left as it is currently situated.

Hello there,

Please grant me an access to your site admin area so I could troubleshoot it from Appearance > Editor. For security reason, please share the working login credentials to kharisblank@gmail.com and enclose the link to this thread.

Regards,
Kharis

Hi Kharis,

I sent you the information and access your requested to gmail.

hi!
what did you do? is the secondary menu inline now?

Please let me know, i have the same problem…

Thanks

Hello There!
How I can create a second menu location in the top bar? It would dtay at the same level of the default menu1 but with alore dpsn position. Can someone already do that, sharing the code?