StudioPress Community Forums
  StudioPress Community Forums > Forums > General Discussion
For help and support, access to your downloads, or to manage your account please log into My StudioPress.

These forums have been set to read-only so you can browse the existing topics for any questions you may have -- and this forum will be removed on July 1st, 2013.

For general discussion on WordPress, CSS and design (NOT for support) visit the new Community Forums.
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 06-30-2009, 12:18 PM
CharlesClarkson's Avatar
CharlesClarkson CharlesClarkson is offline
Community Moderator
 
Join Date: Feb 2009
Location: Stephenville, TX, USA
Posts: 11,356
Default Re: Dynamic Nav for Sidebar pages

Quote:
Originally Posted by bmontgomery
I'd like to create dynamic nav bars similar for news and links similar to the main navigation bar used in the corporate theme.
The navbar code is in the header.php file toward the bottom. Study how wp_list_pages() and wp_list_categories() work and you will be able to make just about any menu you want.

Code:
<div id="navbar">

	<ul id="nav">
		[*]Home
		<?php wp_list_pages('title_li=&depth=4&sort_column=menu_order'); ?>
			[*]Categories
				<ul><?php wp_list_categories('sorderby=name&depth=4&title_li='); ?>[/list]			[/list]    
</div>
In some browsers the navbar depends on this JavaScript to function correctly:
Code:
<script type="text/javascript"><![CDATA[//><!--
sfHover = function() {
	if (!document.getElementsByTagName) return false;
	var sfEls = document.getElementById("nav").getElementsByTagName("li");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);
//--><!]]></script>

HTH,
__________________
Charles "Rubeus Hagrid" Clarkson
StudioPress on Facebook

I'm not really a smart person. I just play one on the Internet.

Please use the HTML or PHP tags for pasting code.
Please make your links click-able: this_is_annoying.com
http://this_is_not_annoying.com.
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 06:39 PM.

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.