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
- Getting only direct child pages in WordPress with get_pages
- Disable Attachment Pages Completely
- How to add a .php file to WordPress
- How to Remove all Instances of edit_post_link
- Any guides on creating custom admin pages?
- Multiple is_page() in page.php
- How to check if feed URL was requested?
- Create WordPress pages with PHP
- Build a content and excerpt grid loop with paging and options for # of posts
- Display sorting options dropdown when using WooCommerce product category shortcode
- Alter query on edit.php
- Drop down+sort blog posts date added/most popular
- What is the most efficient way to search users by their display name?
- Is it possible to generate a page without create in the admin?
- How to change “Shipping Calculator “field label on Cart Page – woocommerce? [closed]
- Remove the first 5 characters of the_title and orderby that
- how to fix error “called incorrectly, should not be accessed directly”?
- My page.php shows the index.php
- Populate editor with some content of a page with a page template
- Set Order Status to Complete After Payment – from another site
- How can I add an area/option for a custom page description?
- Create Page To Count Comments For Each Post In WordPress Site
- comments sorting incorrectly across multiple pages
- get_the_title() gets printed out twice
- How do I find PHP file that contains content of my page?
- WordPress page content outside WordPress
- Using the_excerpt() on a page
- 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?
- Why am I getting a different filename? And how does WordPress load singular.php for both Page & Post? (Fresh WordPress installation)
- How to check if the current page is at a specified path in the URL?
- Counting Search results, and displaying the offset per page
- How to get post ID in a Page?
- Show About and Contact Us page when they’re clicked in the top menu.
- get_total () returns 0 – woocommerce [closed]
- Parsing Menu Items and Blog Posts
- How to use theme function in post/page?
- My php code is not being executed
- Display all pages – in order
- Pagination broken on is_front_page()
- I would like my page editor to be sorted by date created, or updated, instead of in Alpha order, is this possible?
- How to keep track of when a vote is cast?
- trouble with page_id & highlighting current page
- Apply class to every third list item? [duplicate]
- How to include custom code on a page that’s set to act as homepage?
- Can a page contain php code?
- What’s the best way to include PHP code in pages?
- Automatically add images to a menu
- page-slug.php not working but only for specific slug
- Need php code’s output to display underneath a Divi Module
- Insert page content into another page with a changed variable
- How to echo every parent page title?
- How Do I Find & Remove H1 From Site-Title-Wrapper? [closed]
- Retrieve Json data and create multiple pages with it
- How to add page numbering with php?
- Display child page content of a specific parent on home page
- Noindex subscriber author page
- Posts are not looping through correctly
- 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
- Saving a post ID to use in a form elsewhere on website
- WordPress Search
- posts_nav_link pulling in multiple post types
- Remove Post if Advanced Custom Field is checked to fix paging
- How to echo the_title from an array of posts?
- List all anchor links on a page
- Toolbar Hidden in a Virtual Page
- How to break up php code to avoid echo
- Limit the number of child pages
- 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
- My worpress search page is showing no results
- A function to get the content of a page
- WordPress create custom XML RSS feed template
- How can I check if a post with a particular slug or title exists?
- When I click for the redirect link it is showing the content of index.php instead of single_assignment_page.php
- Category Attachment Pagination 404 Error on 2nd Page
- WordPress post-template null warnings
- Custom theme on multisite has issues with standard loop output