• I want to arrange my menu items so that it is in the following order:

    Categories
    Links

    How would I change this code around:

    <div id="menu">

    <ul>
    <?php get_links_list(); ?>
    <li id="categories"><?php _e('Categories:'); ?>
    <ul>
    <?php wp_list_cats(); ?>
    </ul>
    </li>

Viewing 9 replies - 1 through 9 (of 9 total)
  • Moderator James Huff

    (@macmanx)

    <div id="menu">

    <ul>
    <li id="categories"><?php _e('Categories:'); ?>
    <ul>
    <?php wp_list_cats(); ?>
    <?php get_links_list(); ?>
    </ul>
    </li>

    Just a change, for proper validation


    <div id="menu">

    <ul>
    <li id="categories"><?php _e('Categories:'); ?>
    <ul>
    <?php wp_list_cats(); ?>
    </ul>
    <?php get_links_list(); ?>
    </li>

    Moderator James Huff

    (@macmanx)

    ty, BB.

    Thread Starter fliteskates

    (@fliteskates)

    Basketball,

    I tried your code and it displays properly, but it won’t validate.

    Line 77, column 24: document type does not allow element "li" here; missing one of "ul", "ol", "menu", "dir" start-tag

    <li id="links">Links

    Moderator James Huff

    (@macmanx)

    Try this:
    <div id="menu">
    <ul>
    <li><h2><?php _e('Categories'); ?></h2>
    <ul>
    <?php list_cats(0, '', 'name', 'asc', '', 1, 0, 1, 1, 1, 1, 0,'','','','','') ?>
    </ul>
    </li>

    <li><h2><?php _e('Links'); ?></h2>
    <ul>
    <?php get_links_list('-1', '<li>', '</li>', '<br />'); ?>
    </ul>
    </li>

    That is, for the most part, my sidebar code. You have to close the menu of course, but I assume you have more to go after Links.

    Thread Starter fliteskates

    (@fliteskates)

    Mac,

    That worked.

    Thx

    Flagged for Codex

    Thread Starter fliteskates

    (@fliteskates)

    Moose,

    Flagged for Codex?

    Moderator James Huff

    (@macmanx)

    Some one is going to post this Q/A in the soon-to-be official documentation. http://codex.wordpress.org/Main_Page

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘How to arrange menu items’ is closed to new replies.