WordPress.org

Ready to get started?Download WordPress

Forums

Sorting pages in menu (8 posts)

  1. michuk
    Member
    Posted 8 years ago #

    Hello. I need to sort my pages in menu using priorities, not alphabetically. What is the "best practices" way to do it?
    I've got a "Page Order" field for every page, but it doesn't affect the menu.
    Best regards
    Borys Musielak
    jakilinux.org/wordpress

  2. moshu
    Member
    Posted 8 years ago #

    In order to be able to use the Page Order field, you have to include the proper parameter in the wp_list_pages template tag. e.g. <?php wp_list_pages('sort_column=menu_order'); ?>

  3. michuk
    Member
    Posted 8 years ago #

    Thank you. It works.

  4. funkyme
    Member
    Posted 8 years ago #

    This is nice I did so but I am wondering how to sort my pages when you added an external link to your pages menu as I did?
    I don't want this link to appear at the bottom of the list.
    Here's the code:

    • <?php wp_list_pages('sort_column=menu_order&exclude=15&title_li='); ?>

    • friends
  5. Thanks a lot for your help!

  • moshu
    Member
    Posted 8 years ago #

    I assume you don't want that external link at the top either... In this case I'd use the Redirectify plugin - http://redalt.com/downloads/ - and make that link a Page.

  • funkyme
    Member
    Posted 8 years ago #

    Yes right, thanks a lot!
    I have installed the plugin but not sure about next...
    I assume I have to create a new page but then?

  • moshu
    Member
    Posted 8 years ago #

    Yes, create a new Page and give it the title "friends" or whatever is you want to have there, then follow this:
    http://wordpress.org/support/topic/47216#post-261061

  • funkyme
    Member
    Posted 8 years ago #

    Great, perfect!
    Thanks a lot for your help!

  • Topic Closed

    This topic has been closed to new replies.

    About this Topic

    Tags