Forums

wp_nav_menu - use an Ordered List (2 posts)

  1. andystaple
    Member
    Posted 11 months ago #

    I've got a site I'm working on that I'd like to use the Menu system for (because it is just an amazing time saver). However, I'd really like to use the ol (ordered list) instead of an ul (unordered list).

    Has anyone figured out how to do this?

  2. Chip Bennett
    Member
    Posted 11 months ago #

    I've not tried to use this particular argument array parameter, but wp_nav_menu() (Codex ref) includes items_wrap, which you could try to modify.

    It defaults to:

    'items_wrap'      => '<ul id=\"%1$s\" class=\"%2$s\">%3$s</ul>'

    Which you could change to:

    'items_wrap'      => '<ol id=\"%1$s\" class=\"%2$s\">%3$s</ol>'

    So, assuming you're passing a Theme Location (among other possible array parameters), your call might look like this:

    wp_nav_menu( array(
        'theme_location'  => 'my_theme_location',
        'items_wrap'      => '<ol id=\"%1$s\" class=\"%2$s\">%3$s</ol>'
    ) );

Reply

You must log in to post.

About this Topic