(+84) 463.28.7979

Adding multiple WordPress 3 menu in Thesis


You must have been wondering how to add a second menu into your Thesis Theme. This is how we can add a second menu in Thesis.

You need to add the following code in your custom_functions.php which you can find in yourcustom folder in your Thesis theme.

The code for your custom_functions.php

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<?php
//register the menu
if (function_exists('register_nav_menus')) {
register_nav_menus(array(
'secondary' => __('Secondary Menu', 'thesis')
));
}
//function to be called to display the menu
function s_menu()
{
echo '<div id="wrapsmenu">';
wp_nav_menu('theme_location=secondary');
echo '</div>';
}
//add filter below header image to display the second menu
add_action('thesis_hook_after_header', 's_menu');
?>

How to set the second menu

If your login in to your dasdboard and goto Appearance > Menu then you will see a drop down list for the second menu. You can create a new menu and then select it from the drop down. The second menu will be displayed on you site below the header image.

Screenshots

Click Images to enlarge

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>