How do i add a 2nd navigation bar
-
i would like to create more pages, and do not want to reduce the size of the navigation bar. is there a way I can add a 2nd one under the existing one?
thanks
-
lemming theme
bump
Keith, after some time I have just installed a DHTML pull down menu that reads my db and then fills it with the pages. e.g. see my private blog https://edward.de.leau.net.
Its pretty easy e.g.
1) go to: https://www.mycssmenu.com/ and generate your menu. (i like this one best but there are trillions see https://populair.eu/webdesign/
2) Then copy and paste it in your header.php
3) Now you need to make the entries (the XML in this case) dynamic. This takes a bit of php coding to query your database and then automatically generate the menu with the correct entries.(step 3 is only needed when you want have full automation)
it can be done:
change to header.php – basically a second div #nav2:<div id="nav"> <ul class="nav"> <li class="page_item <?php if ( is_home() ) { ?>current_page_item<?php } ?>"><a href="<?php echo get_settings('home'); ?>/" title="Home">Home</a></li> <?php wp_list_pages('sort_column=menu_order&depth=1&title_li=&number=6');?> </ul> </div> <div id="nav2"> <ul class="nav"> <?php wp_list_pages('sort_column=menu_order&depth=1&title_li=&offset=6&number=6');?> </ul> </div>
adapt the digits for ‘number’ and ‘offset’ to fit your page titles.
change to style.css – add this – duplicated styles with #nav2:
#nav2{width:960px; position:absolute; top:90px; left:0px; height:24px; background:url(i/header.jpg) repeat-x top; float:left; margin:0; padding:0; clear:both; font-family:"Trebuchet MS", Arial, Helvetica, sans-serif;} #nav2 ul{height:24px;line-height:24px;float:left;list-style:none;font-size:14px;font-weight:bold;margin:0 0 0 5px;padding:0; clear:both;} #nav2 ul li{float:left !important;list-style-type:none;margin:0;padding:0px 10px 0 10px;} #nav2 ul li:hover{} #nav2 ul li.current_page_item a,#nav2 ul li.current_page_item a:active,#nav2 ul li.current_page_item a:visited,#nav2 ul li.current_page_item a:link{text-decoration:none;color:#FFF;} #nav2 ul li.current_page_item a:hover{color:#FFF; text-decoration:underline;} #nav2 ul li a:hover{color:#FFF; text-decoration:underline;} #nav2 ul li a:active,#nav2 ul li a:visited,#nav2 ul li a:link,#nav2 ul li a{color:#FFF;}
and change ‘margin’ here:
#bgbox{width:960px; float:left; margin:20px 0 0 0px; padding:0;}
wow, thanks guys!
hey cogmios,
i love the idea of using the pulldown menu. once i set it up, will the font style/size etc be automatically adjusted to be consistent with my site?
thanks again for your help
ive tried inserting the pull down menus, but i dont really know the correct place to put the new code. i would like the menu below the title of the site and the descrpition. it keeps putting it at the top of the header, and messes up the format of the site. comigos, if you read this, help!
my header.php is:
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<html xmlns=”https://www.w3.org/1999/xhtml”>
<head profile=”https://gmpg.org/xfn/11″>
<meta http-equiv=”Content-Type” content=”<?php bloginfo(‘html_type’); ?>; charset=<?php bloginfo(‘charset’); ?>” />
<meta name=”google-site-verification” content=”G_B460U45xW-uYqMLM_4-Rk859pdnjtT5vNMiv9IiQM” />
<title><?php bloginfo(‘name’); ?> <?php if ( is_single() ) { ?> » Blog Archive <?php } ?> <?php wp_title(); ?></title>
<meta name=”generator” content=”WordPress <?php bloginfo(‘version’); ?>” /> <!– leave this for stats –>
<link rel=”stylesheet” href=”<?php bloginfo(‘stylesheet_url’); ?>” type=”text/css” media=”screen” />
<link rel=”alternate” type=”application/rss+xml” title=”<?php bloginfo(‘name’); ?> RSS Feed” href=”<?php bloginfo(‘rss2_url’); ?>” />
<link rel=”pingback” href=”<?php bloginfo(‘pingback_url’); ?>” />
<link rel=”shortcut icon” href=”<?php bloginfo(‘template_directory’); ?>/favicon.ico” type=”image/x-icon” />
<?php if ( is_singular() ) wp_enqueue_script( ‘comment-reply’ ); wp_head(); ?>
</head>
<body>
<div id=”box”>
<div id=”header”>
<h1>“><?php bloginfo(‘name’); ?></h1>
<div id=”description”><?php bloginfo(‘description’); ?></div>
<div id=”nav”>
<ul class=”nav”>
<li class=”page_item <?php if ( is_home() ) { ?>current_page_item<?php } ?>”>/” title=”Home”>Home
<?php wp_list_pages(‘sort_column=menu_order&depth=1&title_li=’);?></div>
</div><div id=”bgbox”>
<?php include (TEMPLATEPATH . ‘/lsidebar.php’); ?>
- The topic ‘How do i add a 2nd navigation bar’ is closed to new replies.