• I want to add a subpage menu to my blog that is not in my sidebar. I sort of want it to be horizontal kind of like the one in the wordpress admin interface. How do I do this?

Viewing 1 replies (of 1 total)
  • i used this to get things done:

    <div id="navigation">
    	<ul id="menu" class="menu">
    	<?php wp_list_pages('depth=1&sort_column=menu_order&title_li='); ?>
    	</ul>
    </div>
    
    <div id="subnavigation">
    	<?php
    		if($post->post_parent)
    		$children = wp_list_pages("title_li=&sort_column=menu_order&child_of=".$post->post_parent."&echo=0"); else
    		$children = wp_list_pages("title_li=&sort_column=menu_order&child_of=".$post->ID."&echo=0");
    		if ($children) {??>
    				<ul id="submenu" class="submenu"><?php echo $children;??></ul>
    	<?php }??>
    </div>

    you’ll need to style it so it will be horizontal, and not vertical.
    this is the part in the stylesheet i needed:

    #navigation {position: absolute; left: 0px; top: 36px; width: 820px; height: 36px; background: url('img/transparenz.png');}
    #subnavigation {position: absolute; left: 0px; top: 72px; width: 820px; height: 26px; background-color: #FFFFFF;}
    
    ul#menu {margin:0px; list-style-type: none; height:35px; margin-top: 10px;}
    ul#menu li {float:left; margin: 0px; padding-right: 28px;}
    ul#menu li a, a:visited {color: black; text-decoration: none;}
    ul#menu li a:hover {color: #8f0f26;}
    
    ul#submenu {margin:0px; list-style-type: none; height:35px; margin-top: 5px;}
    ul#submenu li {float:left; margin: 0px; padding-right: 35px;}
    ul#submenu li a, a:visited {color: black; text-decoration: none;}
    ul#submenu li a:hover {color: #8f0f26;}
    
    .current_page_item {font-weight: bold; color: #8f0f26;}

    put it either in the header.php or in your index.php … depending on how you set up your template.

Viewing 1 replies (of 1 total)
  • The topic ‘Subpage Menu’ is closed to new replies.