WordPress.org

Forums

[resolved] Problem With Dropdowns in WordPress 3.0 Menu (2 posts)

  1. thelumberjack
    Member
    Posted 4 years ago #

    I'm working on a theme at the moment and have run into trouble with the WordPress 3.0 menu - more specifically the submenu/dropdowns. The submenus are not functioning as they should - they are always appearing under their parents as opposed to only appearing when hovering over their parent. Here is my code.

    This from my themes functions.php file:

    // add/register WordPress 3.0 menu
    
    add_action( 'init', 'register_my_menu' );
    
    function register_my_menu() {
    	register_nav_menu( 'primary-menu', __( 'Primary Menu' ) );
    }

    This is in my header.php file:

    <div id="top-menu">
    
    <?php wp_nav_menu( array( 'theme_location' => 'primary-menu' ) ); ?>
    
    </div>

    And finally, here is my CSS:

    #top-menu {
    	font-family: 'Droid Sans', serif;
    	font-size: 14px;
    	font-weight: bold;
    	color: #413F40;
    	padding-top: 13px;
    }
    
    #top-menu a:link, #top-menu a:active, #top-menu a:visited {
    	line-height: 27px;
    	padding: 0 8px 1px 8px;
    	display: block;
    	color: #413F40;
    	text-decoration: none;
    }
    
    #top-menu a:hover {
    	line-height: 27px;
    	padding: 0 8px 1px 8px;
    	display: block;
    	color: #FFF;
    	text-decoration: none;
    
    }
    
    #top-menu li {
    	list-style: none;
    	float: left;
    	margin-right: 20px;
    	height: 27px;
    }
    
    #top-menu li:hover {
    	background: url(images/top-menu.png);
    	list-style: none;
    	float: left;
    	margin-right: 20px;
    	color: #FFF;
    	height: 27px;
    }
    
    #top-menu ul {
    	padding-left: 0;
    }

    Here is a screenshot of my menu area:

    http://cl.ly/6Jdt

    As you can see, "Contact" has one submenu item that is simply appearing underneath it permanently. Have I missed something? Thanks!

  2. thelumberjack
    Member
    Posted 4 years ago #

    Solved. Was completely CSS related.

Topic Closed

This topic has been closed to new replies.

About this Topic