Wordpress - Sidebar Static Page Order

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

5 Comments Add your own

  • 1. Steve  |  March 18th, 2006 at 10:48 am

    thanks! Downloaded, installed, and reordered.

  • 2. WebShok  |  June 20th, 2006 at 6:13 pm

    THANKS ! I was looking for somthing like this .

  • 3. joplus  |  June 28th, 2006 at 8:02 am

    Thanks for the help! works perfect!

  • 4. Joost de Valk  |  September 4th, 2006 at 12:43 am

    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. Philip Casey  |  June 21st, 2007 at 1:42 pm

    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.

Leave a Comment

Required

Required, hidden

Some HTML allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Trackback this post  |  Subscribe to the comments via RSS Feed


RSS Feed of Posts RSS Feed of Comments Get Firefox Wordpress