Adding Additional Menu in Wordpress Site

I am trying to add an additional menu above Main Navigation in the header of my Wordpress site.

Currently I have the following Code in my functions.php...

----------------------------
/*Top Menu Navigation */

register_nav_menu( 'topnav', __( 'Top Nav Menu', 'customizr' ) );


/* Main Menu Navigation */

add_filter('tc_menu_display', 'acub_menu_display');
function acub_menu_display($output) {
    echo preg_replace('| class="dropdown-toggle" data-toggle="dropdown" data-target="#"(.+?)<b |', ' class="a-stripped" $1</a><a href="#" class="dropdown-toggle a-caret" data-toggle="dropdown" data-target="#"><b ', $output, -1);
      
    }

----------------------------

I have the following code in my header.php, and I see the menu items above all pages including the dashboard and it breaks my wordpess administration pages.


wp_nav_menu( array( 'theme_location' => 'topnav', 'container_class' => 'topnav-menu' ) );

I am not yet comfortable working with PHP.

Here is the placement in my code.

<!DOCTYPE html>
<!--[if IE 7]>
<html class="ie ie7" <?php language_attributes(); ?>>
<![endif]-->
<!--[if IE 8]>
<html class="ie ie8" <?php language_attributes(); ?>>
<![endif]-->
<!--[if !(IE 7) | !(IE 8)  ]><!-->
<html <?php language_attributes(); ?>>                          
<!--<![endif]-->
<?php tc__f('rec' , __FILE__ , __FUNCTION__ ); ?>

      <?php do_action( '__before_body' ); ?>

      <body <?php body_class(); ?> itemscope itemtype="http://schema.org/WebPage">
            
            <?php do_action( '__before_header' ); ?>

 wp_nav_menu( array( 'theme_location' => 'topnav', 'container_class' => 'topnav-menu' ) );

               <header class="tc-header clearfix row-fluid" role="banner">
                  
                  <?php do_action( '__header' ); ?>

            </header>

            <?php
             //This hook is filtered with the slider
            do_action ( '__after_header' )
            ?>
deitercat2Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

James RodgersWeb Applications DeveloperCommented:
it is breaking your layout due to being processed for the nav bar.

why are you pushing it through tc_menu_display? it is not necessary.

what is it you want to do?see on output?
0
deitercat2Author Commented:
I want the additional nav bar to appear above/ before the main menu navigation,

I want something similar to the sub navigation on  this site: http://www.solarvac.com.au/new/
except I want the additional nav on the top.
0
James RodgersWeb Applications DeveloperCommented:
just take out the filter, what you see on that site is just a menu with a different style
0
Amazon Web Services

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

deitercat2Author Commented:
Ok, I have gone back to the beginning.  I have stripped out everything and placed

register_nav_menu( 'topnav', __( 'Top Nav Menu', 'customizr' ) ); into my functions.php.


So my question is what should I have in my header.php and where should I place it so that the menu appears before the header menu.

I have not made changes in my header.php file it is the same as what is above.

Thank you.
0
James RodgersWeb Applications DeveloperCommented:
above the header menu add this

 wp_nav_menu( array( 'theme_location' => 'topnav', 'container_class' => 'topnav-menu' ) );

that's it

I have used this same code to have multiple menus in a header
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
deitercat2Author Commented:
I appreciate your help.  Thanks for you patience.
0
James RodgersWeb Applications DeveloperCommented:
did it work?
0
deitercat2Author Commented:
It worked and is now showing up at the top of my pages but I placed it in the functions.php file.   The menu is also showing at the top of all my dashboard pages.
0
James RodgersWeb Applications DeveloperCommented:
ok try this


if(! is_admin()){

put menu code here
}
0
deitercat2Author Commented:
That worked.  Thank you again.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
WordPress

From novice to tech pro — start learning today.