Wordpress – Sidebar Static Page Order

Posted on March 15th, 2006 at 06:20pm I got an e-mail today from someone who found my My Link Order plugin but wanted to order his pages instead. At first I wasn't completely sure if you could but a quick look at the core files, database, and WP site answered that question. Yes, you can set the order in which pages show up in your sidebar, but it is a little clunky. When you edit a page, there is an option to set the "Page Order" to a certain number (in WP 2.0 this is one the collapsable boxes). Now follow these steps:
  1. Set the Page Order on each page in your desired order.
  2. Check if that changes the order, if not you will need to make a change to your template to tell it to sort on that order instead of by name.
  3. Go to Presentation->Theme Editor and select the Sidebar page (I'm assuming this is where your list of pages is being displayed). Find the line that is using a function named wp_list_pages, the whole line should look something like this:<?php wp_list_pages('title_li=<h2>Pages</h2>' ); ?> A parameter to tell it to sort by your order needs to be added: <?php wp_list_pages('title_li=<h2>Pages</h2>&sort_column=menu_order' ); ?>
With that added your pages should now be sorted. I might create a plugin similar to My Link Order to handle the setting of orders because the current way is annoying and very very very user-unfriendly.

Tagged with: ,
Posted under: Geek Stuff

Related Posts

5 Responses to “Wordpress – Sidebar Static Page Order”

  1. thanks! Downloaded, installed, and reordered.

  2. THANKS ! I was looking for somthing like this .

  3. Thanks for the help! works perfect!

  4. I would be willing to pay a small amount if you made a plugin for this :) I really could use it on the sites where i use WordPress as a CMS.

  5. Thank you very much for this. The problem was driving me crazy on a site for a friend, and your solution worked like a dream. I’ll definitely use it again along with your My Page Order plugin. Excellent work.