Tag Archives: Drop Down Menus

Displaying WordPress categories in a horizontal dropdown menu.

April 16, 2008 by aaron
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(&#039;sort_column=name&sort_order=asc&style=list&children=true&hierarchical=true&title_li=0&#039;); ?> </ul> </div> I added this to my header.php, but you can add it anywhere you want it to appear.
Read More ⟶

Displaying WordPress categories in a horizontal dropdown menu.

April 16, 2008 by aaron
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(&#039;sort_column=name&sort_order=asc&style=list&children=true&hierarchical=true&title_li=0&#039;); ?> </ul> </div> I added this to my header.php, but you can add it anywhere you want it to appear.
Read More ⟶