How to Add Second Navigation Menu in Thesis Theme

This tutorial is exclusively for Thesis Framework, a new templating system for WordPress. Create any sort of layout for your website using Drag & Drop Builder.

Share This Article:

How to Add Second Navigation Menu in Thesis Theme by using WordPress menu support. Thesis Theme comes with a primary menu by default and you can add any number of navigation menus by following this tutorial.

It is a common practice to have two navigation menus, so that categories can be listed in one menu and other links related to blog can be displayed in primary one.

add-second-navigation-menu-thesis

Manually Add Second Navigation Menu in Thesis Theme

Secondary navigation menu can be added manually by using functions and hooks.

second-navigation-menu-thesis-theme

  • Login to WordPress and go to Thesis > Custom File Editor.
  • Open custom_functions.php file and add below code to it.
  • Replace # with your links, change titles and save the file.
  • Voila, secondary navigation menu is added to thesis.
/* Start of Second Navigation Menu */
function second_nav_menu() {
?>
<ul id="secondnav">
<li><a href="#" title="Link 1">Link 1</a></li>
<li><a href="#" title="Link 2">Link 2</a></li>
<li><a href="#" title="Link 3">Link 3</a></li>
<li><a href="#" title="Link 4">Link 4</a></li>
<li><a href="#" title="Link 5">Link 5</a></li>
<li><a href="#" title="Link 6">Link 6</a></li>
<li><a href="#" title="Link 7">Link 7</a></li>
<li><a href="#" title="Link 8">Link 8</a></li>
</ul>
<?php
}
add_action('thesis_hook_after_header', 'second_nav_menu');
/* End of Second Navigation Menu */

Dont forget to add your own links and text in this code.

CSS for Second Navigation Menu in Thesis

Its time to style the secondary menu you have just added to Thesis Theme. Add the below CSS to custom.css file in your thesis theme. If your are new to thesis, you can edit custom.css file using Custom File Editor.

/* CSS for Second Navigation Menu in Thesis */
.custom ul#secondnav {
background: none repeat scroll 0 0 #EFEFEF;
border-style: none;
float: left;
list-style: none outside none;
width: 100%;
}
.custom ul#secondnav li {
border-right: 1px solid #CCCCCC;
float: left;
padding: 8px 10px;
text-decoration: none;
}
.custom ul#secondnav li:hover {
background: none repeat scroll 0 0 #DDDDDD;
}
.custom ul#secondnav li a {
color: #000000;
font-size: 12px;
letter-spacing: 0.03em;
}
.custom ul#secondnav li a:hover {
text-decoration: underline;
}

This CSS will give just a basic style to your theme and you can change it based on the color scheme of your theme.

Add Second Navigation Menu with WordPress Menu Support

Thesis Theme got navigation menu support for wordpress nav menu and thesis nav menu. According to the theme author, thesis_nav_menu will be depreciated from the next update i.e Thesis 2.0. So we recommend to use WordPress nav menu and here are some steps to create second navigation menu in Thesis.

navigation-menu-thesis-theme

How to add Navigation Menu to Thesis Using WordPress Menus

Creating and maintaining a WordPress menu is very easy. Just go to Appearance > Menus and create a new menu by adding some links to it. Now, assign it by selecting a location in “Theme Locations” pane. Finally, a click on save button will display a cool navigation menu in your theme.

wordpress-menu-thesis-theme

Another impressive thing is you can add pages, categories etc links also.

Add Second Navigation Menu by registering WordPress Menu

Now, coming to the second navigation menu, we are just going to add theme support for WordPress menu and will pre-define the menu location as “Secondary Menu”. After creating another new menu, you will assign it by selecting the “Secondary Menu” in Theme Location Pane.

second-navigation-menu-wordpress-thesis-theme

Here is the code you need to add to custom_functions.php and we have given it a name as “Secondary Menu”, which you can change it based on requirement.

/* WordPress Menu Support for Second Navigation Menu */
add_action('init','register_menu');
function register_menu() {
register_nav_menus(
array(
'secondary'=>'Secondary Menu'
));
}
function wordpress_menu_support() {
wp_nav_menu('theme_location=secondary');
}
add_action('thesis_hook_after_header','wordpress_menu_support');

This is how the secondary menu will look after adding it to theme.

wordpress-navigation-menu-support-thesis-theme

Hope you like this informative article on How to Add Second Navigation Menu in Thesis Theme and if you need any sort of help, drop a comment here.

This tutorial is exclusively for Thesis Framework, a new templating system for WordPress. Create any sort of layout for your website using Drag & Drop Builder.

Genesis is the most flexible WordPress theme framework that comes with tons of options. We have been using Genesis on all of our blogs and recommending the same to you. Every bit of it is coded according to the standards. Give it a try!

Comments

  1. Mairaj Pirzada says:

    HI Bharat,

    Seems that you’ve great skills in Coding, while the most confusing thing for me is the coding. I always hate it and love simplicity.

    You’re doing too good, I mostly like your theme, this is awesome and looks always professional.

  2. Mahesh Verma says:

    thanks sharing this article very useful :)

  3. ehmud says:

    Thanks for detailed article about thesis. You seem to have extensive understanding of thesis. Can you write on how to check thesis browser compatibility?

    • WPSquare says:

      Hi Ehmud, many online tools and applications are available to check cross-browser compatibility and we will write an article on it very soon.

Speak Your MindComments Policy →

*

Looking for More Awesomeness?

Read previous post:
display-related-posts-wordpress-more-relevantly
Display Related Posts in WordPress More Relevantly

Display Related Posts in WordPress More Relevantly and accurately. It is important to make your blog readers feel comfortable, so...

Close