WordPress Thesis Theme : moving the menu

by Roberto on August 13, 2009

in Work

Thesis Theme for WordPress navigation menu

By default WordPress Thesis Theme puts the navigation menu at the top of the page.
But it is very easy to move the menu around in your theme using the Thesis hooks.
A common situation is when you want to move the menu below the header of your theme, for example to have your logo at the top of the page.
To solve this, edit the file wp-content/themes/thesis/custom/custom_functions.php of your WordPress installation and add this code :

//Remove the navigation menu from the top of the page
remove_action('thesis_hook_before_header', 'thesis_nav_menu');
 
//Add the navigation menu after the header div
add_action('thesis_hook_after_header', 'thesis_nav_menu');

If you want to add your logo at the top of your page, in the same file add this code :

//Add an action to the "before title" hook
add_action('thesis_hook_before_title', 'mysite_before_title');
 
//Add an action to the "after title" hook
add_action('thesis_hook_after_title', 'mysite_after_title');
 
function mysite_before_title() {
echo '<div class="header-title">';
echo '<a href="/"><img src="/wp-content/themes/thesis/custom/images/mysite.png" alt="My site" border="0" /></a>';
}
 
function mysite_after_title() {
echo '</div>';
}

Suggested books

WordPress Plugin Development: Beginner's GuideWordPress Theme Design

Leave a Comment

Previous post:

Next post: