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' );
Related Posts:
- Sort by page information by Ascending Numbers
- change the default order of posts only for specific categories
- Order BY Most Liked And Published Between Previous Week Monday And Next Week Monday
- Removing custom sort order from admin page listing
- WordPress sorting posts by date and title using a dropdown
- How to sort (orderby) a query done by a template function before the ‘foreach’ loop?
- Query category-specific, paginated posts and allow viewer to change sort order
- Sending the reset password link programatically
- Any guides on creating custom admin pages?
- Multiple is_page() in page.php
- Build a content and excerpt grid loop with paging and options for # of posts
- Drop down+sort blog posts date added/most popular
- WordPress admin never finishes saving page on site with large page count
- Archive listing of posts by publish year (multiple years)
- WooCommerce – Customer Order History Pagination
- add_rewrite_rule with bottom priority doesn’t handle the WordPress pages
- Listing all sub-pages?
- How can I set custom order use this function
- Help with a custom page template – listing contents of childpages?
- Passing the page ID to a login php script
- How can the plugin directory path be returned into ?
- list posts and wrap them alphabetically A-Z
- WooCommerce: Add Payment Gateway Field to Webhooks [closed]
- Limiting woocommerce line_total decimal length
- Order posts randomly, not by date
- Working with query_posts ( arrays and query strings)
- Can’t search posts using WP_QUERY inside AJAX Function
- Way to querry data (tags) from a wordpress database?
- Global variable $post returning incorrect object
- Nesting if statements to echo only one string based on what tag was filtered?
- Using loop pagination on single.php
- How to add a php custom page to WordPress
- Sort custom meta column by other meta value
- how to fix error “called incorrectly, should not be accessed directly”?
- Set Order Status to Complete After Payment – from another site
- How can I add an area/option for a custom page description?
- How do I find PHP file that contains content of my page?
- WordPress page content outside WordPress
- Inject class in body when particular page template is used
- Use .php file as page instead of wordpress page & template file?
- Use WordPress function in php file
- How to list posts from a plugin taxonomy?
- How to check if the current page is at a specified path in the URL?
- Parsing Menu Items and Blog Posts
- Display all pages – in order
- How to keep track of when a vote is cast?
- page-slug.php not working but only for specific slug
- Need php code’s output to display underneath a Divi Module
- How Do I Find & Remove H1 From Site-Title-Wrapper? [closed]
- Display child page content of a specific parent on home page
- How to tag the main tag? [closed]
- PHP Output also in Child theme, but different
- $wpdb->get_results breaking page?
- Unique PHP on each Page
- How to Display a List of Child Pages For a Parent Page in WordPress
- limit number of post for achive page
- If is page, archive or search output this code
- WordPress Search
- posts_nav_link pulling in multiple post types
- Remove Post if Advanced Custom Field is checked to fix paging
- How to break up php code to avoid echo
- How do I add my PHP app to a WordPress page whilst keeping semantic URLs?
- Page load timer?
- How to WP_Query posts order by parent title?
- search.php to search only the post title
- Page not visible in ‘All pages’ after being added through PHP
- Hot to check if new posts have been published since page load and notify online users?
- Cascading dropdown select search based on Parent Page & Child Page
- Edit and delete permissions pages and posts
- When I click for the redirect link it is showing the content of index.php instead of single_assignment_page.php
- Is there anyway I can call the year once?
- How can I change the background color of divs dynamically (depending on an order-status in woocommerce)?
- Custom post type order by post_title
- Display page content in different sections – based on page break block?
- How to override WooCommerce Order Item Meta with data from Cart?
- loading a php file to a specific page id
- Get current_post in reverse order with pagination
- Array sorting assistance
- How to only fetch certain Tag ID’s
- Div Missing In Custom Loop Query
- Create a custom theme-specific page, invisible in the admin-panel?
- Create a hierarchical loop at predefined markup requirements
- Page 2+ of taxonomy archives does not recognise sort-order from dropdown
- Why isn’t my link attribute getting my css?
- Sort posts by title, sort array by largest number [duplicate]
- Show results for multiple page-types
- WordPress – show all posts + ones with specific tag
- Display selected parts from selected pages on the frontpage?
- Query specific posts per user selections from dropdown menus
- Dropdown Menu for Query_Posts
- ISOTOPE – Missing/Invalid Arguement Get Terms
- I want Page titles and excerpts to show up on home.php in certain order
- ACF: Echo page title when checkbox is checked
- category & sub category order issues in wordpress
- How to refresh a template page on WordPress in 3 seconds – easiest method?
- Pagination in category.php not functioning
- How to handle parent and child pages?
- How can I display all these movies in DESC order by modified?
- /page/2/ redirect to 404
- What is wrong with my sorting logic?