Update to 1.5.3 Menu Order

  • Anonymous


    Hi HeleneS,

    Ok, in the code you pasted, on the first line, you just need to make a very small adjustment… just add a comma.

    So, your first line of the code you pasted here is 'sort_column' => 'menu_order post_title',. Simply add a comma to make it look like this:

    'sort_column' => 'menu_order, post_title',

    Save your functions.php file and you should be good to go.



    HI Josh, Not so new to WP but not too advanced either other than some introduced me to filezilla a while back. I have followed your instructions to edit above, but how do I save the changes from the Dashboard. When i could not save it i did my usual using filezilla and edited it there. It worked but how do i save direct in the dashboard editor tool as that would be so much easier.



    Well, you can ftp it to your computer. Make the changes in a text editor. Save the file. And then copy it back over to your server using ftp.

    NOTE: It’s always a good idea to make a backup of your original file. This way, if you make a mistake with the code, you have the original to copy back if needed.

    One thing… I noticed the code you provided is using “post_title” rather than “page_title”. The code you want to change for the menu pages uses “page_title”. Try searching for “page_title” and follow the steps above.

    I’ll have to ask about the “post_title” code as I’m not sure if this needs to be adjusted or not.



    If you want to use the dashboard editor… that is fine also. Just go to your editor, make sure “Graphene” is selected in the top right drop-down menu, and the click “select”.

    Look at the listing of files on the right, you will find “Theme Functions (functions.php)”. Click this file, make the adjustments as needed, and then click “update”.




    Thanks Josh, but what’s confusing me is that the list I need to reorder is of pages. Everyone else seemed to locate a bit of code that referred to pages, but the bit of code that the Mozilla search threw up for me (shown above) referred to posts only. Sorry to bother you again, but is it OK for me to carry out the change you recommended and will it reorder the pages as well? I have tried searching for page_title, but Mozilla search comes up with an error… Thanks once again in advance for any help with this.



    Thank you all! I paniced… 😛



    on my (back level) ISP host it is necessary to have a space before the comma, like so:

    'sort_column' => 'menu_order , page_title',

    otherwise it doesn’t work..


    Syahir Hakim



    I think I made a mistake in the code there. It should be:

    'sort_column' => 'menu_order, post_title',

    Notice that it’s post_title instead of page_title.



    Syahir… I don’t think so. There is only one spot in the core functions.php that has 'sort_column', and it’s syntax is using the page_title. I don’t see another 'sort_column' anywhere in the file.

    I just don’t want to confuse any future viewers of the thread.


    Syahir Hakim


    Yep, because sort_column is used for the wp_list_pages() function, while other custom queries that use WP_Query() use orderby, with a slightly different syntax. It’s this slight difference in syntax that brought about the mistake in the first place.

    See http://codex.wordpress.org/Function_Reference/wp_list_pages

Viewing 10 posts - 11 through 20 (of 32 total)

  • You must be logged in to reply to this topic.