A Couple of weeks ago I did a Comparison between Thesis v/s Genesis v/s Swift & I found Thesis to be superior between the other two. But as I had mentioned in that post, Thesis still lags behind in terms of the basic design.
So I decided to design the theme of DailyBlogging myself. While designing & customizing our new theme, I found that we need to manually add certain things in order to make a rocking blog theme.
One of the most important aspect of a blog is the Category Menu. By default thesis only provides us to add categories in the Main Nav Menu. But if we need to add a custom & separate menu specifically for Categories, then it’s a bit of a code work.
For adding a Category menu right below your Site’s logo, Just navigate to your Thesis theme’s directory folder, then goto the folder named ‘custom’ and edit the custom_functions.php
file. Add the below code in that file.
function categories_menu() { ?> <ul class="menu"> <?php wp_list_categories('title_li=&orderby=id&number=10&exclude=1') ?> </ul> <?php } add_action('thesis_hook_after_header','categories_menu');
Here categories_menu in the first line defines the function & inside it; is the real content/body part of the function. The second line assigns a class named menu for the <ul> tag. This is mainly for styling purpose & it styles your Category nav same as the Main Nav Menu. Third line of this code contains the main PHP function with which WordPress filters which categories to display in the Category nav menu & which not to. The fifth & the sixth line is the thesis hook to display our categories_menu below/after the header function.
Subscribe to Our RSS Feeds / Daily Updates as I will be coming up with more such Thesis Tutorials.
Did this tutorial help you to add a Category Navigation Menu ??