WordPress.org

Ready to get started?Download WordPress

Forums

How to arrange menu items (10 posts)

  1. Fliteskates
    Member
    Posted 9 years ago #

    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>

  2. <div id="menu">

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

  3. basketball
    Member
    Posted 9 years ago #

    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>

  4. ty, BB.

  5. Fliteskates
    Member
    Posted 9 years ago #

    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

  6. 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.

  7. Fliteskates
    Member
    Posted 9 years ago #

    Mac,

    That worked.

    Thx

  8. NuclearMoose
    Member
    Posted 9 years ago #

    Flagged for Codex

  9. Fliteskates
    Member
    Posted 9 years ago #

    Moose,

    Flagged for Codex?

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

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.