Hi guys, a question from non webmaster who is learning this skill too :-)

Order of pages for top menu works fine, but in a sidebar widget with Pages lists all I see is alphabetic list of pages.

How to make them appear in order as well?

Dani AI

Generated

— the sidebar is showing an alphabetic list because whatever the theme/widget is using to print pages is sorting by title. is right that using WordPress’ custom menu UI avoids this, but if you prefer to keep the automatic pages list you can make the sidebar follow the same manual order the top menu uses.

Replace the call that outputs pages with one that sorts by the page order (menu_order). Typical code to put in your sidebar template (sidebar.php or the template part the theme uses) is:

<?php
wp_list_pages(array(
  'sort_column' => 'menu_order,post_title',
  'title_li'    => '',
));
?>

After that, set each page’s Order value on the Page edit screen (Page Attributes -> Order). WordPress uses that integer (menu_order) when sorting. If you do not want to edit template files, a small plugin such as “Simple Page Ordering” lets you drag-and-drop pages in the admin and saves those Order values without touching code.

If editing feels risky: make a backup first, use a child theme (so updates do not overwrite changes), or download the theme file by FTP before editing. To get targeted help here, copy the exact sidebar code (Appearance -> Editor -> sidebar.php or open the file in an FTP editor), paste it into your reply wrapped in triple backticks so it shows as code, and remove any sensitive info — someone can then point to the exact line to change.

Recommended Answers

All 2 Replies

What was the outcome you wanted to see there?

It sounds like you are using an older template that used the legacy menu for Wordpress. The newest Wordpress templates have a menu that can be fully configured on the back end to be in any order you wish, custom labels, and have offsite links in the menu.

http://codex.wordpress.org/Appearance_Menus_SubPanel

If that is not an option I would suggest posting the code you have for that menu on the sidebar.

If that is not an option I would suggest posting the code you have for that menu on the sidebar.

Can you please advise how?
I am afraid to screw something.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.