By default, posts and pages are sorted after the date. If you want sort pages by “order” field, which is visible on edit page, you have to set orderby
parameter:
add_action('pre_get_posts', 'change_order');
function change_order($query) {
if ( is_front_page() || is_home() ) {
$query->set( 'orderby', 'menu_order' );
$query->set( 'order', 'ASC' );
}
return $query;
}
Put code in functions.php
file.
More about orderby parameters you will find here.
Related Posts:
- Get current menu_order
- Increment Page Order As Pages Are Created
- Automatically set page order on create page
- get_pages() as per custom menu order
- I would like my page editor to be sorted by date created, or updated, instead of in Alpha order, is this possible?
- Exclude pages by menu order
- How to change the order of the Front Page so it doesn’t appear first
- Option for pages order in backend
- How to set post slug when using wp_insert_post();?
- Check if is on child-page of a particular page
- Restrict admin access to certain pages for certain users
- Require title for pages
- How to embed page content in a blog post
- How do I order pages and categories by ID or name in the same query?
- Notify admin when page is edited?
- How do I modify this page template to show subpage excerpts (not post excerpts)?
- What are the options for running custom css and javascript files on a page?
- How to build a post and comment editing form in a page?
- Wrong Sub-Page Order
- WP won’t save changes in post (any)
- Can’t change parent page
- can i create 2 blog ‘feeds’ within one blog
- Password Protected Page Not Displaying Content After Entering Password
- Created pages not showing up in ‘All Pages’ list
- I made a custom page but WordPress seems to strip any HTML I put in this page
- How to exclude shortcode from specific page IDs if it’s set to global
- WASM page in WordPress website
- Include a specific page in your template
- Is it possible to have a landing page based on the visitors location?
- Play Video on Homepage Only
- Remove number in URL
- Dynamically change page that loads
- Page title not showing up
- How to add Posts to a Page
- Proper way to implement/access a built-in page in my theme
- remove/hide pages from users backend
- Page not found error when adding text `2 = 2 ^ 1` to the page
- Related Links Page with moderated, user suggested link submissions
- Is it possible to skip certain specified pages when using < prev and next > links?
- Custom Page Order instead of Alphabetical
- If a page does not exist, include a different page?
- How to redirect a page to another?
- Combining ‘depth’ with ‘include’ in wp_list_pages()
- Page template no longer exists – metaboxes won’t save
- A static page view call every custom page templates
- Wrapping images in tags based on size
- Get the ID of the direct parent page
- How to control who can view certain pages in BuddyPress? [closed]
- How to add prefix slug in static wordpress page?
- access control for assets in a website powered by wordpress
- How to remove only pages from Admin Bar?
- How to make a page unsearchable in blog search?
- Published pages missing
- Getting ACF Field in Page – From the Footer
- Rewrite to load homepage for a different url
- logout redirect only from admin page
- redirect index.html inside folder to wordpress page of same name
- Show content if page is a grandchild of top level page
- Does Feedburner send notifications about WordPress pages?
- Ordering Pages and Increasing Navigation
- Static Website No Titles But Still Nav
- Search results to be only posts & children of page ID
- Embedding Password Protected (Private) “Blog Posts” BLOCK that shows Images and Excerpts on Password Protected Page (not the home page)
- On the list of Pages, clicking to Edit a particular page redirects to the list of trash
- How to hide a page in wordpress made for menu
- My pages are using my Index.php and not my page.php
- WordPress custom pages in a folder
- How to change default home link title?
- Return true if parent page id matches
- Recovering a page from the drafts
- Not allow add New Page for role ‘editor’
- Pulling images from the media folder category to display inside a page
- My Password Protected Pages Aren’t Working
- How to detect if some page template has been selected
- Why Google map can not show full size in a page?
- Page view displays not properly after update wordpress
- What’s the best way to manage sections on a page?
- Converting HTML to WordPress theme: integrating pages function and using its text editor, conditional enqueuing
- Display custom_post_type with current taxonmy of a page
- How to output different content of page on different places in my template
- WordPress slow pages/post, hangs and white text
- Prevent page from displaying
- Custom Filter using meta_value in wordpress admin list not working
- Loading custom jQuery and HTML in a WordPress page
- Add feed to a custom page
- Directory location of new page
- Grabbing the_content from “about us”
- Dynamic content in pages
- Page specific values in widgets
- Javascript will not run properly
- link a custom page into menu
- Show different number of posts on second page of category
- Use get_posts() with ‘post’ and ‘page’ queries at the same time?
- appearance of new page
- How can a user login on a wordpress page?
- For some reason my posts are not showing up on my front page [closed]
- How to customize the author page in wordpress?
- User profile in front-end
- custom css in one page
- Why is a page shown with ‘hidden’ next to the name in the list of pages if the page is set to public?