WordPress Plugin – My Page Order Archived

This page is an archive for the older versions of My Page Order. All new comments should be made here.

Gives you manual control over the order of your WordPress pages by letting you easily set an explicit order. Works with subpages too. Now with built-in Widget support.

If you’d like to say thank you or make a donation please visit my Gifts and Donations page.

Download My Page Order:

Updates:

  • Update 3/30/2008: For WP 2.5, I’ve moved all future downloads to the WordPress Plugin directory. This page will stay up as a testament to this plugin’s popularity over the past 2 years.
  • Update 9/30/2007: Checked compatibility with WP 2.3.
  • Update 6/30/2007: The release you’ve all been waiting for!!! Built in widget support, hacking the widgets.php file is a thing of the past.
  • Update 5/17/2007: Javascript include bug fix, won’t mess up the editor now, redownload if you had the previous 2.1.3 version. 2.2 update coming soon but current version should still be compatible. Things are good with 2.2.
  • Update 5/10/2007: Big update! I rewrote the interface and replaced the unfriendly up and down arrows with spiffy new drag and drop ordering. Check it out, definitely worth the upgrade, I’ve only tested on 2.1.3 but it should work on any 2.1.x install.
  • Update 1/22/2007: Updated to WP 2.1.
  • Update 1/14/2007: Checked compatibility with WP 2.0.6, no changes needed.
  • Update 9/8/2006: Checked compatibility with WP 2.0.4, removed annoying javascript popup warning when arrows were clicked without anything selected, pages with no subpages will no longer show up in the dropdown, change to prevent submission if nothing selected in dropdown.

This is my third WordPress Plugin and I’m continuing with the idea of being able to control the order of how things are displayed. Categories and Links have various means of being ordered, there’s just no way to manually set an order.

Pages on the other hand have a means of specifying an order which was introduced in WP 2.0. The Page Order tab was added on the Write Page screen. The way this ordering is implemented though makes it completely useless. The order doesn’t automatically increment when you start a new page and it is a major pain to insert a page where you want it. Got a new page you want to insert at the top of 25 other pages? Have fun incrementing the order on 25 pages (unless it accepts a negative number which is just another bad idea).

This plugin gives you a simple interface that allows you to arrange the order of your static pages. It uses and sets the same field in the database as WP does so if you have set an order before it will be preserved.

Installation instructions:

  1. Move mypageorder.php to /wp-content/plugins/
  2. Activate the My Page Order plugin on the Plugins menu
  3. Go to the “My Page Order” tab under Manage and specify your desired order for pages
  4. If you are using widgets then just make sure the “Page” widget is set to order by “Page order”. That’s it.
  5. If you aren’t using widgets, modify your sidebar template to use correct sort parameter, “sort_column=menu_order”:
    wp_list_pages(‘sort_column=menu_order&title_li=<h2>Pages</h2>’);

Sort attribute

In your templates (accessible through the theme editor or downloading the file off the server) there might be several places your list of pages gets outputed. To use your sort order each instance must have the sort column argument set like the following:

wp_list_pages(‘sort_column=menu_order’);

That’s it. Out of the box everything is there to make the manual ordering happen, it just needs a better interface to make it less time consuming for the WP user to manage and my plugin is really just a stopgap measure until something better gets built into the WP release.

If you have any problems let me know, I am more than happy to help resolve any issues you may have. I’ll respond to your comment through email so be sure to put a valid email in. Even if you don’t have problems leave a comment or throw a couple bucks to buy some beer.

398 Replies to “WordPress Plugin – My Page Order Archived”

  1. Great! I was thinking about implementing something like this for a long time. Is there a way to enable drag’n’drop for the lists?

  2. That would definetely be something for My Page Order 2.0, I haven’t done an interface like that but it would be good experience for me. If I have time in the future to improve the plugin that would be on the list.

  3. It is unlikely it would work unless there is a way to tell the widgets to sort off the menu order like you can do with the standard template tags. I haven’t used widgets so I’m not going to be much help there.

  4. First, the page order works great. Perfect, in fact. My question has to do with the formatting of the “Pages” title. I had to change this:

    Pages’); ?>

    To this:

    How can I bring back the title formatting?

  5. Sorry, my above comment code wasn’t formatted right to display (silly me). It should have read as follows. I had to change this:

    <?php wp_list_pages(‘title_li=<h2>Pages</h2>’); ?>

    To this:

    <?php wp_list_pages(‘sort_column=menu_order’); ?>

  6. I installed the plugin, and have an extensive collection of pages on my site, but the “Manage->My Page Order” tab doesn’t display anything except the footer (WordPress logo and “get Firefox” logo).

    Any suggestions?

  7. Thanks for the reply Orvar, I guess I should mention on this page that I respond to all questions and problems through email since it is much quicker and easier.

  8. Andrew,

    I couldn’t find your email address. Sorry to write a support request here.

    I keep getting the following:

    Parse error: syntax error, unexpected ‘=’ on line 6

  9. nuts didn’t mean to submit.

    line 6 is the call – “?php wp_list_pages(’sort_column=menu_order&title_li=Pages’); ?”

    (omitting the less than and greater than carrots for formatting in this post)

    Any clues?

  10. I did go looking for an email address but could not find one, so posting here.

    This plugin doesn’t seem to
    want to work for me. I am running the latest version of wordpress and I also
    have another plugin for pages called Category Order that I’m running
    along with MyPageOrder.

    I tried placing the php code within the sidebar of my theme (Clean Cut
    1.0) where my pages are listed but it keeps giving me this error:

    *Parse error*: syntax error, unexpected ‘=’ in

    I get this error whether or not I have both of MyPageOrder and Category Order
    plugins activated or just MyPageOrder.

    Any ideas on what might be going on?

    Thank you for the help… and thank you so much for developing this
    plugin, it’s exactly what I was looking for, as long as I can get it to
    work :)

  11. For those who use widgets :
    I looked for the,”wp_list_pages” function in widgets.php. widgets.php file is in the “wp-content\plugins\widgets” folder
    Look for the line and change it to :
    wp_list_pages(’sort_column=menu_order’);
    as stated above. It works …
    Thank you for the nice plug-in.

  12. And another try:
    “?php wp_list_pages(‘sort_column=menu_order&title_li=’ . __(‘Pages’) . ” ); ?”

    Just replace ” with

  13. Thanks, it’s a great plugin, it should be integrated into the next version of WordPress. It’s just a common sense way to order pages instead of trying to learn code.

    So thanks :)

  14. Do you insert the line into the header.php? Thats where my menu is. But when I edit the code there it gives an error message or it screws up my menu. I’ve tried all the different code from the comments. Anyone?

  15. Great component, but a “heads up”…

    I installed it, made changes to the header however when I opened the component under manage, there were no arrows.

    I then opened it in ie7 (yawn) and got error images for the arrows and was at least able to move stuff up and down.

    I’m not sure what the error could be except perhaps missing arrow images. I’ll check when I get some time.

    Again, thanks for the component. I agree something like this should be standard in WP.

  16. Yeah, the arrows not showing up has happened to people before. All the plugin files have to be in plugins/mypageorder, the URLs to the images are sadly hard coded to that location. In my next version I might just ditch the images and use styled buttons, it would eliminate a variable.

  17. Is there a way to disable the “Pages” title that automatically shows up with this plugin? I only want the names of the pages to show up.

    Thanks for any help.

  18. Man, I love you.

    This saves so much time and headache!
    Brilliant stuff! Thank you thank you thank you!

    As for the arrows, the folder “mypageorder” doesn’t appear to be in the zip – if you rezip it with the folder intact I’m sure less people would get confused.

    Thanks again!

  19. I had trouble with the up and down arrow images not appearing also. It turned out Adblock was blocking them – try exempting your site from adblock or turning it off and refreshing the interface.

    (Not the first time this sort of thing has happened to me!)

    Tom

  20. Great plugin!

    I noticed that if sort_column=menu_order is not the first query string variable that the plugin doesn’t work. No big deal, but just thought people would like to know ;)

  21. Hey, I really REALLY REALLY want this plugin to work, but I can’t get it to!

    I finally got the arrows to show up, but the order still doesn’t change. I’ve tried everything mentioned above, and still nothing. Please tell me what I can do.

  22. I see the plugin page, I see the arrows, I have pages… but there’s no pages populating the multiselects in My Page Order management tab.

    Nothing next to Click to Order Pages and nothing in Order Subpages.

    WP 2.1
    My Page Order for WP 2.1

  23. my last comment is invisible because of special characters. on line 70 the plugin uses the shorter version of the php opening tag, ie. bracket then question park, instead of bracket then question mark then ‘php’. this will cause some servers to report an error.

    thanks again for the great plugin!

  24. YAY! After much consternation, I finally got this plugin to work. And there was much rejoicing!

    I’m not even a PHP noob — I’m a total PHP nitwit. I don’t know the first thing about PHP, so this whole thing has been trial and error for me.

    For anybody else who’s have problems with this, here’s what I did to get it to work for me. Just like this page mentions, I updated all instances of wp_list_pages to the line mentioned on comment#28 in my widgets.php file and my sidebar.php file (where my menu is). But it still wouldn’t work for me. So I searched all my other files for any mention of wp_list_pages, found it in functions.php, and changed it there as well. Ta-da! Now it works! If that’s mentioned anywhere else on this pages, I totally missed it. :(

    Also, the first time I updated wp_list_pages I got an error message too. But I found that when I copied and pasted the text in from this web page, the quotation mark is what was blowing it up. I had re-type the quotation mark (single quote), and then it worked fine.

    And thank you thank you thank you! I’ve been having fits over getting my pages to display in the order I actually want them in. This is a great plugin!

  25. I’m using both mypageorder & mycategoryorder with trouble-free installation and operation. I do have a request that would be of great use to me.

    I have a main page, “Locations” and subpages for each state under it. It makes for a very cluttered menu.

    Locations
    —Alabama
    —Arizona
    —etc.

    My question is – could you possibly add a checkbox in the list to make pages hidden?

    Thanks for great plugins.

  26. Hello,

    Great plugins, would you be interested in some customization work? If so please contact me via e-mail.

    Thank you

  27. all 3 plugins work fine, had some trouble due to the fact that I had not read point 4 of the installation instructions carefully enough. be pricise and persistent when installing. Thanks Andrew these plugins are a great step forward.

  28. (using widgets) every time i try to edit my templates with the wp_list_pages(’sort_column=menu_order&title_li=’); my whole blog dies on me with some sort of parse error.

    what am i doing wrong here?

    @40 – Kim, did you get any errors before you changed your page order list in all 3 files?

  29. tres, can you send me the parse error along with the file it is bombing out in, I’ll send you back a version with the correct syntax.

    froman118 at gmail.com

  30. Thanks for the plugin…
    I’m from brazil, don’t have a paypal account…

    My country it’s far from modern stuffs like paypal :(

    in US it’s usual commom sense… but here, these things take years for them bring to Brazil.

    Someday I hope to make a donation to you…
    sorry for bad english

  31. With this fresh new install of WP 2.1.2, MyPageOrder now works clearly !

    Thanks for you help Andrew.
    (This guy is great !)

  32. I’m still not able to get this to work with WP 2.1.2 even when I edit the on line from:
    wp_list_pages(“title_li=”);
    to
    wp_list_pages(’sort_column=menu_order’);

    I just get an error and I have to re-upload the widget plugin to fix it. what do i need to do?

  33. If you want to change the code of you page order, you must change code in funtions.php of your theme:

    and in your widget file
    wp_list_pages("sort_column=menu_order&title_li=");

    then it will work with mypageorder. the ” make the difference. it won’t work with only ‘ that.
    Greetings

  34. Sorry, my post was not really clear ;)

    If you want to change the code of you page order, you must change code in funtions.php of your theme:

    and in your widget file
    wp_list_pages("sort_column=menu_order&title_li=");

    then it will work with mypageorder. the ” make the difference. it won’t work with only ‘ that.
    Greetings

Comments are closed.