Fully Customized Drop Down Menu

Menus can be tricky. Rather than being locked into the just using menu sort order, or alphabetical order, combine the two using wp_list_pages(); You can style the drop downs to respond on hover using CSS.

<ul id="main_menu"> 

$children=wp_list_pages( 'echo=0&title_li=' ); 

     if ($children) {

       $output = wp_list_pages ('echo=0&depth=2&title_li=&sort_column=menu_order,post_title&exclude=2');

          echo $output; 

     } ?>

</ul>

Note the “,post_title” within the sort_column parameter.  This allows the first level to be sorted by menu_order, and the second

Leave a Reply

Posted in php
katherine as a flat graphic icon

About Me

I’m an African / Ojibwe First Nations Web Developer living in Winnipeg, Manitoba.

Visit the Tips and Blog to see what I’m working on.