WordPress Subcategories as Dropdown Menu by CSS Help
How to add Child Categories as dropdown menu in Wordpress by CSS help.
In last post i have written about subpages dropdown menu’s now Here Im telling you about Categories and subCategories. Its also similar way to do, as we have done on pages. we need to add Css classes as i have added below and make a small change on wordpress theme’s header or sidebar where you needed it
Step 1
Css/ add these classed in your theme css
/*- Nav / Dropdowns-*/ #nav, #nav ul{ Â padding: 0; Â float:left; Â list-style: none; } #nav a { Â font-size:12px;font-family:Arial, Tahoma, Verdana;line-height:34px;text-transform:uppercase;font-weight:700;color:#dfdfdf;display:block;margin-right:5px;text-decoration:none;padding:0 20px 0 20px } #nav li { Â float: left; Â line-height:27px;Â } #nav li a:hover { background: none; color:#50daf7; } #nav li ul { Â position: absolute; Â width: 15em; Â left: -999em; Â padding-top:0px; } #nav li:hover ul, #nav li.sfhover ul { Â left: auto; Â z-index:1000;Â } #nav li ul li { Â Â Â background: #000; Â border-bottom:1px solid #1e2527;Â Â border-left:1px solid #1e2527;Â Â border-right:1px solid #1e2527;Â Â Â Â line-height:18px;Â Â width:20em; }
///////
Step 2
replace category codes as below
Search this
<?php wp_list_categories(’title_li=’ ); ?>Â
and replace
<ul id=”nav”>
<?php wp_list_categories(’title_li=’ ); ?>Â
</ul>
 thats is it.
please check other post for subpages dropdown
http://www.w3cgallery.com/w3c-blog/wordpress-hack/wordpress-sub-pages-as-dropdown-menu-by-css








