Learn Thesis Theme Fast to Build Unique and Beautiful Websites

  • Thesis Designer Guide is the fastest way to learn the Thesis framework.
  • A step-by-step guide walks you through all the essential things you need to know to become a Thesis design expert.
  • You don’t need to be a programmer to learn Thesis design.
  • The complete Thesis Designer Guide covers all the coding basics and tools needed to become a Thesis expert.

Learn Thesis Theme! Get Started Now!

How to Put Categories Before Pages in Thesis Navigation Menu?

by in How To,Thesis Theme Customization,Thesis Theme Tutorials

 

Normally thesis theme navigation menu shown menu items in particular order like Home, pages, Categories, Links (it may be a post link or other link) and  Rss feed link. Few of our readers have asked about how to change nav items order in thesis menu. Some of them asking about how to display categories before pages?. Reader comments ….

Thanks for the tutorial.

Do you know if there is a way to put all of the categories before the pages?

This is great! But do you have any idea how to make the category appear somewhere else in the menu, instead of as the last menu item only?

In this thesis theme customization video tutorial I am going to explain how to reorder our navigation menu items in thesis theme.



We know how to add links in navigation, for this we have option in wordpress admin dashboard. Goto thesis options under ‘thesis options’ in left sidebar of the dash board. Inside the thesis options we have navigation menu which has 5 options to add or remove items in navigation menu. Here we can add or remove pages, categories, links, homelink, and feedlink.

Display categories before pages in navigation menu.

To align categories before pages in navigation menu change the following code in nav_menu.php file. To achieve the above statement follow these steps.

  • Login your ftp with cpanal user name and password.
  • Open lib/ functions folder the path of this folder is Public_html/fourblogger.com/wp-content/themes/thesis_16/lib/functions.
  • Inside the functions folder we have nav_menu.php file open this file inside we have the following codes. Swap the below code which is differentiated in different color.

The default code as follows

if ($thesis['nav']['pages']) {
foreach ($thesis['nav']['pages'] as $id => $nav_page) {
if ($nav_page['show']) {
$nav_items[] = $id;
$page_data[$id] = get_page($id);
$parents[$id] = ($page_data[$id]->post_parent != 0) ? $page_data[$id]->post_parent : 0;
}
}
if (is_array($nav_items)) {
foreach ($nav_items as $id) {
if (!$parents[$id])
$nav_array[] = thesis_nav_array($id, $nav_items, $current);
}
}
if (is_array($nav_array))
thesis_output_nav($nav_array, $page_data);
}

if ($thesis['nav']['categories'])
wp_list_categories('title_li=&include=' . $thesis['nav']['categories']);

The above code having two parts the first part is for pages second part is for categories. If you want your categories before header swap these two parts.

After swaping the above code it looks like below code.

if ($thesis['nav']['categories'])
wp_list_categories('title_li=&include=' . $thesis['nav']['categories']);

if ($thesis['nav']['pages']) {
foreach ($thesis['nav']['pages'] as $id => $nav_page) {
if ($nav_page['show']) {
$nav_items[] = $id;
$page_data[$id] = get_page($id);
$parents[$id] = ($page_data[$id]->post_parent != 0) ? $page_data[$id]->post_parent : 0;
}
}
if (is_array($nav_items)) {
foreach ($nav_items as $id) {
if (!$parents[$id])
$nav_array[] = thesis_nav_array($id, $nav_items, $current);
}
}
if (is_array($nav_array))
thesis_output_nav($nav_array, $page_data);
}

Now save your nav_menu.php file and refresh your site. Now you are got your categories before pages in navigation menu. The below image I am having featured, makemoney and testing categories before pages.

categories before pages in menu

By the similar way nav_menu.php file having codes for home, pages, categories, link and feed link if you want you can change your order by re arranging the file with help of the above video. Share your experience in comment section. For more checkout our all Thesis theme tutorials..

VN:F [1.9.13_1145]
Rating: 0.0/5 (0 votes cast)

Related Tutorials:

  1. How to Add Categories and Dropdown Categories in Thesis theme Navigation Menu
  2. Thesis Theme Customization For navigation Menu Round-Up
  3. How to Add Dropdown Navigation Menu in Thesis Theme
  4. How to add Background Image in Thesis Theme Navigation Menu
  5. How to Change Navigation Menu Color and Location in Thesis Theme

{ 13 comments… read them below or add one }

Jaydip Parikh

One more out of the box tip from your site. Great job done buddy.

Reply

Pascal

Thanks Jaydip. I am happy about you continuously reading and
participating discussion here.

Reply

aaslin

hi,how to add social network following banners like twitter,facebook and feedburner in header(you have placed it in sidebar here).

Reply

paul

thanks. so how would you put LINKS that are used in the nav BEFORE a specific page? example: page1 | page2| link1 | page 3

Reply

Pascal

By hacking thesis core files, you can do that. I think it can’t be done just through custom_funtions.php. The code changes done at thesis core files other than custom_functions.php will make problem when you upgrade your thesis next time.

Reply

paul

so do you know what the code would be for use in the custom_functions.php file to make this happen?

Reply

paul

sorry, didn’t read your reply correctly… now i see that it can’t be done with custom functions file… bummer.

Reply

paul

for anyone who is interested, i figure this one out. create a custom page template with just this code: header(“Location: http://yourlink.com“);

Then add a new page to the blog and assign this page template.

Now just add the page to the navigation wherever you want…when you click it, you’re redirected to the link in the template file…

Works great.

Reply

Johannes

Hi Paul,

have the same problem (want to put category tabs between home and About) but don’t get yet how you exactly did it.

1) you create a custom page template (any tips where I can find a tutorial on that?)
2) then you enter the code – but what exactly is the Location-URL? All I have so far is my categories …

Thanks!!

Johannes

Reply

Jeremiah Ware

Just a quick note on the article, even though this topic is somewhat old. Suresh mentions editing nav_menu.php and Pascal notes that the change would be lost upon upgrading.

I’d like to offer that instead of editing nav_menu.php, copy the code from the function thesis_nav_menu() and place it into a new function in custom_functions.php.

Then, place two more lines in custom_functions.php…
remove_action(‘thesis_hook_before_title’, ‘thesis_nav_menu’); // Remove Thesis Menu
add_action(‘thesis_hook_before_title’, ‘thesis_nav_menu_custom’); // Input Thesis menu in the header

You may need to use different values for the first argument, but that’s the gist.

This method gives the same functionality and leaves thesis core files intact.

Just thought I would mention it.

Reply

Jason

Hiya,

You’ve got a good article here, but what I need is a couple more steps further.

How can I order the categories in the main nav by ID? It is coming up alphabetical and I need more control on the order.

I’ve tried the ‘My Category Order’ plugin with no success.

Thanks!

Reply

Suresh

hai jason,

To change the navigation menu category order use the below code..
http://pastebin.com/0yKb3kj7
you can add your style in custom.css file

Reply

bdkamol

Great tutorial. I am successfully done this.
Thnx 4 sharing..

Reply

Leave a Comment

{ 3 trackbacks }

Previous post:

Next post:


Popular Tags:

    wordpress order category before page, reorder links thesis, add categories to menu using code, move page after categories in nav menu, move pages after categories thesis, page navigation thesis blogger theme, put navigate link, remove header category thesis, thesis change order menu, thesis menu alphabetical order