WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Page Order in Sidebar (8 posts)

  1. jbn10161
    Member
    Posted 8 years ago #

    I have two pages. The page with a title that is alphabetically first has a page order of '1,' and the page with a title that is alphabetically second ("Welcome") has a page order of '0.' The sidebar shows the Welcome page, which I want first, as the second in the list. I assume this is because of its alpha order, but I'm not sure. Is there any way to make that page the first in the sidebar list?

  2. oriecat
    Member
    Posted 8 years ago #

    What tag are you using currently?

    You probably need this?
    <?php wp_list_pages('sort_column=menu_order'); ?>

  3. jbn10161
    Member
    Posted 8 years ago #

    No tag, just the desktop UI, putting a number in the "page order" field. Where would I put the code you provided? I assume in the sidebar template, but where there?

  4. skippy
    Member
    Posted 8 years ago #

    There should be a wp_list_pages() tag in your sidebar. Inside the parentheses, please 'sort_column=menu_order'.

    See the wp_list_pages documentation for all the available options.

  5. jbn10161
    Member
    Posted 8 years ago #

    Perfecto. Thanks. (And thanks for the cite to the Codex, which clarified how to add the parameter to a preexisting parameter.)

  6. SpiritwalkerCA
    Member
    Posted 8 years ago #

    Specifically, I changed mine to:

    <?php wp_list_pages('title_li=<h2>Pages</h2>&sort_column=menu_order'); ?>

    Which worked great.

  7. DeanK
    Member
    Posted 8 years ago #

    Thank you! After searching through a dozen or so forum threads, this solution worked best. Until I added the extra:

    &sort_column=menu_order

    into the wp_list_pages php code, I could only have an alphabetical list of results.

  8. pericson
    Member
    Posted 7 years ago #

    If you are using widgets edit the widget.php file under Plugins/Plugin Editor. Here is what the command line should look like:

    wp_list_pages("title_li=&sort_column=menu_order")

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags