Cascading CSS Navigation In Thesis

When it comes to delivering custom websites at competitive pricing any good service provider should build and maintain an inventory of foundation design elements to help with rapid deployment of client sites. Such an inventory can take a great deal of time to acquire and maintaining the design elements or template foundations to be consistent with trends and front line practices can be a daunting task.  Thankfully there are a few good theme development platforms that eliminates many of these design frustration for a designer.  Once such theme is the THESIS by DIYThemes.

Over the past year, THESIS has grown exponentially in terms of its use by developers as a foundation framework for site design. Due no doubt to the lofty list of features that THESIS includes, THESIS makes the project development flow a bit quicker and easier to maintain.  Because of the popularity of THESIS, the ever growing list of people that wish to add our WordPress Menu Creator plug-in to a THESIS design has also grown.   Although THESIS has menu management features integrated with the themes options, clients and web designers often seek to employ our plug-in where much tighter and more CMS like control over menu management is desired. So I’m going to show you the quick and easy way to deploy Menu Creator in Thesis.

Thesis Hooks – Replacing Stock Menu with Menu Creator

Now, in order to begin this relatively simple process you must have THESIS 1.6 installed and you must have renamed the example custom folder to /custom/ in order to make the edits necessary for using the menu creator. You should also have the menu creator installed and activated. Optionally you should create a menu and title it as “Top Navigation” or something similar.

Now, before we begin the actual edits please keep the following in mind. It is very important to note that the generated code by the WP Menu Creator is simply an XHTML compliant unordered list. The < ul > will have an ID assigned to it based on the menu ID so the very first menu you create would be Menu ID 1, so the resulting markup for the unordered list would be < ul id=”mc_menu_1″ > As such, we will address the styling options toward the end of this article.

Simply navigate to the THESIS settings menu and select custom file editor. Then, select from the drop down list the custom_functions.php to add the necessary code.

Thesis Options - File Editor

The default custom_functions.php looks like this;

function custom_bookmark_links() {
global $post;
?>
<ul class="bookmark_links">
<li><a rel="nofollow" href="http://delicious.com/save?url=<?php urlencode(the_permalink()); ?>&amp;title=<?php urlencode(the_title()); ?>" onclick="window.open('http://delicious.com/save?v=5&amp;noui&amp;jump=close&amp;url=<?php urlencode(the_permalink()); ?>&amp;title=<?php urlencode(the_title()); ?>', 'delicious', 'toolbar=no,width=550,height=550'); return false;" title="Bookmark this post on del.icio.us">Bookmark this article on Delicious</a></li>
</ul>

<?php
}

Just after the closing bracket, assuming your custom_functions.php file has not been previously edited, you will enter the code as follows. Make sure you change the menu ID to be consistent with the actual WP Menu Creator ID.

WordPress Menu Creator Menu ID

The following code tells thesis to remove its “thesis_nav_menu” and add the menu creator. If the displayMenu function exists (if the plugin is activated) it will display menu ID 1. If not I have this example to show the categories.

function menucreator() {
	if (function_exists('displayMenu')) {
	displayMenu(1);
	} else {
		echo '<ul id="mc_menu_1">';
		wp_list_categories('title_li=');
		echo '</ul>';
	}
}

remove_action('thesis_hook_before_header','thesis_nav_menu');
add_action('thesis_hook_before_header','menucreator');

Alternatively you could replace the section where wp_list_categories exists and show the actual thesis navigation if the menu creator is not active or a menu is not created. The code would look like this.

function menucreator() {
	if (function_exists('displayMenu')) {
	displayMenu(1);
	} else {
		thesis_nav_menu();
	}
}

remove_action('thesis_hook_before_header','thesis_nav_menu');
add_action('thesis_hook_before_header','menucreator');

The final result should look something similar to this.

function custom_bookmark_links() {
global $post;
?>
<ul class="bookmark_links">
<li><a rel="nofollow" href="http://delicious.com/save?url=<?php urlencode(the_permalink()); ?>&amp;title=<?php urlencode(the_title()); ?>" onclick="window.open('http://delicious.com/save?v=5&amp;noui&amp;jump=close&amp;url=<?php urlencode(the_permalink()); ?>&amp;title=<?php urlencode(the_title()); ?>', 'delicious', 'toolbar=no,width=550,height=550'); return false;" title="Bookmark this post on del.icio.us">Bookmark this article on Delicious</a></li>
</ul>

<?php
}

function menucreator() {
	if (function_exists('displayMenu')) {
	displayMenu(1);
	} else {
		echo '<ul id="mc_menu_1">';
		wp_list_categories('title_li=');
		echo '</ul>';
	}
}

remove_action('thesis_hook_before_header','thesis_nav_menu');
add_action('thesis_hook_before_header','menucreator');

Some Final Notes

As mentioned above, the Menu Creator renders the UL with the menu ID so each menu can be individually styled. Since it will render the menu without any CSS reference at all you can opt to include the existing CSS for the THESIS menu in the custom css file by changing the directives or you can add your own CSS. There are countless examples of CSS navigation using this markup so the possibilities are endless.

Please feel free to ask for help if you need it.

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Blogosphere News
  • Fleck
  • LinkaGoGo
  • LinkedIn
  • Live
  • MSN Reporter
  • MySpace
  • Netvibes
  • RSS
  • Technorati
  • Twitter
  • Webride
  • Yahoo! Bookmarks
  • Yahoo! Buzz
  • Yigg

17 Comments to WP Menu Creator with Thesis Theme

Comments

  • Howard from Gascony Property says:

    I have about 40 sites, and use Thesis on one site. Although it is extremely powerful, I do find it geeky. There is good support but I need a simpler but functional template.

    My preference is for Flexibility Theme or Mimbo if I want a newspaper style.

    I would be interested in any feedback about these templates – if there are serious issues then I will have to concentrate on Thesis.
    Howard@Gascony Property´s last blog ..2009 – Only The Best Results In 10 Years ! My ComLuv Profile

  • Howard from Help with Debt says:

    Thanks Jared – another of our Mimbo customisations above – looking forward to your next posting too.
    Howard@Help with Debt´s last blog ..Wealth and Success with a Millionaire Mindset My ComLuv Profile

  • I should have added some CSS. Here is an example below. Replace images as you see fit.

    /*-=-=-=[ Styling WP Menu Creator ]=-=-=-*/
    #navcontainer {background: url(images/top.gif) repeat-x; height: 80px; padding: 0px 0px 0px 15px; overflow: hidden; position:relative;}
    #guidenavbar {margin: 0; padding: 0; position: relative; height: 80px; background: url(images/rtds_menubar.jpg) 0 0 no-repeat; padding-left: 2px; font: normal 12px Arial, Helvetica, sans-serif;}
    ul#mc_menu_1{margin: 2px 0 0 0; padding: 0; float: left; font-weight:700; font-family: arial; font-size:14px;}
    ul#mc_menu_1 ul ul {display:none;}
    #mc_menu_1 li {padding: 0; margin: 0; float: left; display: block;}
    #mc_menu_1 li li {background:none;}
    #mc_menu_1 li.mainlevel_current {}
    ul#mc_menu_1 ul li a {font-weight:bold;}
    #mc_menu_1 li ul {position: absolute; top:44px; height: 36px; left:0; width: 100% !important; width:980px; display: none; margin: 0; padding: 0;}
    #mc_menu_1 a {color: #fff; text-decoration: none; cursor: pointer;}
    #mc_menu_1 a:hover {color: #ccc;}
    ul#mc_menu_1 li a:hover {background:#000 url(images/small-nav-tab.gif) right center no-repeat; color:#fff;}
    ul#mc_menu_1 ul li a:hover {background:none; color:#99ccff;}
    #mc_menu_1 li ul a:hover, #guidenavbar li.mainlevel_current ul a:hover{color: #000;}
    #mc_menu_1 li:hover ul, #guidenavbar li.sfhover ul {display: block; z-index: 6000;}
    #mc_menu_1 li a {display: block; float: left; padding: 0 15px; height: 36px; line-height: 36px;}
    #mc_menu_1 li:hover a, #guidenavbar li.over a {}
    #mc_menu_1 ul li {border-right: 0;}
    #mc_menu_1 li ul a, #mc_menu_1 li.mainlevel_current-navmenu ul a{display: block; float: left; color: #fff; font-weight: normal; padding: 0 10px; background: none; height: 25px; line-height: 25px;}
    
  • Good article with lots of information. Def. something that I may look into adding to my website.

  • shiv from Tips Tricks says:

    Recently i have installed thesis theme and looking for a nav bar. Lets see how it works for me. Thesis is really powerful theme.
    shiv@Tips Tricks´s last blog ..Free Video Calling Nokia E75 Fring and skype My ComLuv Profile

  • Geoff from San Diego Homes says:

    I’ve found the WordPress Menu Creator to be very useful in organizing neighborhood sections of my San Diego real estate site. It does take some getting used to, but keeping a spreadsheet with the order of the pages makes it a lot easier.
    Geoff@San Diego Homes´s last blog ..California Home Buyer Tax Credit! My ComLuv Profile

  • David Bendah says:

    I like the menu creator I just wish there was documentation that explained things in more detail.

    I’ve used Menu Creator on all of my blogs but I really struggle with configuration and implementation and I would be willing to donate to this project if someone would be willing to produce some documentation.

  • Christina from Lån says:

    How does the created menu look like when using Thesis? I would very much like to get a sample or screenshot of it.
    Christina@Lån´s last blog ..Thorn My ComLuv Profile

  • leonardo from consultoria de qualidade says:

    Really interesting!
    Think that this can help me!
    Nice Blog by the way!

  • Victoria from Best Amazon Deals says:

    Yes, I’m glad you posted this. I was going to post something similar but now I don’t think I’ll need to. Do you mind if I link to it from one of my blogs? My visitors might like to see this post too. Have a good day, Victoria

  • Thanks for the information, but i would like to add images in background how ? I am using thesis 1.7.
    Sarkari Naukri´s last blog ..BSF Recruitment 2010 My ComLuv Profile

    • The default menu selector for the first menu would be #mc_menu_1 Where you see the 1 at is the menu id. You simply add the custom CSS to thesis to style in the menu items.

      Jared

  • Lisa Udy from Homes For Sale Logan UT says:

    I just started a Thesis blog about 4 months ago. I have an iFrame of my IDX website, but this looks like a nice option. When I get some more money, I will be back to check out your options. Great post!
    Lisa Udy@Homes For Sale Logan UT´s last blog ..Appraisers Coming In Low To Avoid Lawsuits My ComLuv Profile

Trackbacks/Pingbacks

Leave a Reply

This site uses KeywordLuv. Enter YourName@YourKeywords in the Name field to take advantage.

© 2006 - 2010 - UltimateIDX Inc. - All Intellectual Rights Reserved

UltimateIDX offers custom RETS and IDX Services and Real Estate Lead Management. Call (702) 335-6580 Today to find out more! UltimateIDX, Inc. - 6088 Villa Lante Av., Las Vegas - Nevada - 89113