Forums

[resolved] wp_list_page - PAGE ORDER question (3 posts)

  1. speedysubmarine
    Member
    Posted 2 years ago #

    I'm a newbie to code and have what I hope is a simple Q:

    I have the wp_list_page command in my site, but it isn't allowing me to change the order of the pages listed.

    the full code is this:
    wp_list_page('depth=1&title_li=&exclude=143&sort_column=menu_order' )

    Right now, I have three pages: About, Contact, Selected. The current order shown on the site is Contact, Selected, About. I think this is the order in which the pages were created. I've tried just changing the 'date/time' stamps on the pages to hack it that way, but it isn't working. (Just fyi if it matters, the display is horizontal, not a list, and the title 'pages' has been removed).

    Can someone help tell me how I can alter the code so I can customize the order? I want the order to be About, Contact, Selected (which, for now, is conveniently alphabetical... but doing something that might work for future pages that isn't alphabetical could be helpful).

    Thanks!

  2. Samuel B
    moderator
    Posted 2 years ago #

    you will likely get a better answer, but you could include the pages in the order you want them
    like
    `wp_list_page('depth=1&title_li=&exclude=143&include=14,67,34&sort_column=menu_order' )
    with your real id's of course

  3. speedysubmarine
    Member
    Posted 2 years ago #

    thank you so much! this is helpful.

Topic Closed

This topic has been closed to new replies.

About this Topic