wordpress - Old as this Earth horizontal wp menu issue :) -


problem seen here http://soloveich.com/

trying make whole menu horizontal, home link keeps running away

            <div id="navmenu"> <ul> </li><a href="<?php echo get_settings('home'); ?>">home</a></li> <li><?php wp_nav_menu( array( 'theme_location' => 'main-menu' ) ); ?></li> </ul> </div> 

and css

#navmenu ul {margin: 0; padding: 0;  list-style-type: none; list-style-image: none; float: right; } #navmenu li {display: inline; padding: 5px 5px 35px 5px} #navmenu {text-decoration:none; color: white; } #navmenu a:hover {color: purple; } 

thanks in advance!

the wordpress wp_nav_menu items outputting div , ul inside placing it. output going be:

<ul>    <li>home</li>    <li>         <!-- call wp_nav_menu -->            <div>                <ul>                  <li>...</li>                </ul>            </div>         <!-- end wp_nav_menu -->    </li> </ul> 

the child div , ul display block , causing go line.

your best bet add home link either inside wordpress menu in admin interface, or beginning of ul through wp_nav_menu function:

<?php wp_nav_menu( array( 'theme_location' => 'main-menu', 'items_wrap' => '<ul><li id="item-id"><a href="' . get_settings('home') . '">home</a></li>%3$s</ul>' ) ); ?> 

see codex more info: http://codex.wordpress.org/function_reference/wp_nav_menu


Comments

Popular posts from this blog

c# - How Configure Devart dotConnect for SQLite Code First? -

java - Copying object fields -

c++ - Clear the memory after returning a vector in a function -