Sort query_posts for Parent Pages to menue order or the count?

thanks to a member here i display my Parent Pages in a 2 column grid with title and excerpt. But for some reason i can’t figure out how to sort all 5 Pages by the menu order for example or the order number i assigned.
i display them by using

query_posts( ‘post_type=page&post_parent=0’ );

Read More

so that the child Pages won’t displayed. but i can’t figure out how to order them.. Any ideas??? thanks in advance!
Dan

Related posts

Leave a Reply

1 comment

  1. Dan,

    First a advice: don’t use query_posts to get your pages. Use get_pages instead. Here is how you can do what you are asking using get_pages.

    get_pages( array( 'parent' => 0, 'sort_column' => 'menu_order' ) );
    

    You can also specify whether you want to sort in ascending order or in descending order. Default sorting order is ascending.

    get_pages( array( 'parent' => 0, 'sort_column' => 'menu_order', 'sort_order' => 'desc' ) );
    

    For more information check get_pages on codex.

    In case if you want to keep using query_posts, here is how you can order pages by menu order, you will need to use orderby argument.

    query_posts( 'post_type=page&post_parent=0&orderby=menu_order' );