Displaying WordPress categories in a horizontal dropdown menu.
One of my readers recently asked how I created my horizontal menu bar: the short answer is by mixing CSS and Javascript. The first step is to get WordPress to display the menu as a hierarchical list without a title. <?php wp_list_categories('sort_column=name&sort_order=asc&style=list&children=true&hierarchical=true&title_li=0'); ?> We then wrap this WordPress code in the following so we can style it. <div style="text-align:center;"> <ul id="menu" style="padding:0; margin:0;"> <?php wp_list_categories('sort_column=name&sort_order=asc&style=list&children=true&hierarchical=true&title_li=0'); ?> </ul> </div> I added this to my header.php, but you can add it anywhere you want it to appear.