WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] problem with drop down menu and child pages... (2 posts)

  1. t.davor
    Member
    Posted 3 years ago #

    Hello!
    i got Japanese Style theme installed and looks like that theme doesn't support drop down menu (child pages). any idea what to change to get drop down menu working???
    my *nav* code looks like:

    <div id="nav">
    		<ul>
    			<li <?php if(!is_page()) echo 'class="current_page_item"'; ?>><a href="<?php echo get_option('home'); ?>/">Home</a></li>
    			<?php wp_list_pages('title_li=&depth=0'); ?>
    		</ul>
    
    	      </div>

    and my CSS for nav is:

    /* Navigation
    -------------------------------------------------------------------*/
    #nav {
    	width: 800px;
    	height: 45px;
    	margin-left: 30px;
    	position: relative;
            top: 225px;
    }
    #nav ul {
    	margin-left: 10px;
    	position: absolute;
    	bottom: -1px;
    	overflow: hidden;
    	height: 45px;
    }
    #nav ul li {
    	float: left;
    	margin-right: 3px;
    	padding-left: 3px;
            font-weight: bold;
    }
    #nav ul li.current_page_item {
            width: 122px;
            height: 45px;
    }
    #nav ul li a {
            width: 122px;
            height: 45px;
            background: url(images/nav_bg.jpg) no-repeat;
    	display: block;
    	text-decoration: none;
    	color: #333;
    	line-height: 45px;
    	text-align: center;
    }
    #nav ul li a:hover { color: #555; }
    #nav ul li.current_page_item a { background: url(images/nav_bg.jpg) no-repeat; color: #ff0000; }
  2. Chip Bennett
    Theme Review Admin
    Posted 3 years ago #

    The code you posted already supports display of Child Pages in the nav menu. See this:

    wp_list_pages('title_li=&depth=0');

    That depth=0 argument tells wp_list_pages() to display Pages of any depth.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.