Use wp_get_nav_menu_items
to get the items from your menu.
Use wp_list_pluck
to extract just the object_id
from each menu item. This is the ID of the page the menu item refers to.
You’ll now have an array of the page IDs in the order they appear in the menu.
Create a new WP_Query
for post_type
page
and pass that array as post__in
argument, and set orderby
to post__in
.
Related Posts:
- How to configure WordPress to handle 75,000 pages?
- How to disable posts and use pages only
- Custom SQL Query for WordPress page
- Password protected post or page – error message by wrong password?
- Get next/previous cousin page
- I want only my sub-pages to be clickable in the navbar
- How restrict page for users logged? [closed]
- Only allow new subpages to be created
- Hide Visibility Option From WordPress Publish Metabox
- How do I turn comments off for pages, but not posts?
- How to make nested page structure?
- List Child Pages of Parent Parent Page (Child pages from Grand Parent)
- How to add meta boxes to Pages
- Form action redirect to the same page
- How do I create a separate page for each author?
- Overriding the currently selected menu item
- How to incorporate Documentation into wordpress?
- Missing parent page attribute
- Hiding Page by Title from Editing
- Two Search pages, One search form
- Get page by its ID and display it on another one
- Add a predefined page to site
- creating and styling a within a page
- How do i change page template in bulk?
- What are trackbacks?
- How to enumerate a list of posts?
- How can I redirect to my custom page without loading the Dashboard itself?
- Remove ID page from wp_count
- category slug and page slug same
- New user Registration data imported into Page
- Could be a namespace conflict (?) with login form and register form on the same page
- The concept of non-blog content
- Loading Multiple Comments Pages via Ajax?
- Change base URL of pages created by certain users
- Updated WordPress, now getting errors on site
- Edit Parent page drop menu when creating a page
- Get parent of current page
- How to list a page tree?
- How to create a page and display only the posts with a specific custom field value?
- Attachment pages stealing page slugs
- How to add an external php page with wordpress?
- Exclude pages by menu order
- WordPress pages not working out correctly with HTML
- Change page name in admin list
- How to exclude authors from get_pages()
- Folder wordpress page redirect
- Dynamic page with comments
- How to rewrite a page url
- Manage content on multiple pages synchronysly?
- Display pages in alphabetical order
- Listing all child-pages of a parent-page on the parent-page and each child-page?
- Loading scripts on specific pages using PHP in footer.php
- How to recover pages from site with only ftp? [closed]
- get_page() – Only variables can be passed by reference
- Need Help with Custom ModRewrite
- upgrade has caused page content to disappear
- Website jumps to top when scrolling down
- How to fix broken URL – https://mywebsite.com/comments/feed/
- Can’t find the page that is using a slug
- Translate dashboard metabox
- Revert a Draft page to its original version
- Loading ACF Field content on a 404.php page
- My edits are not saved
- Cannot Create A Page or Post in WordPress 5.2.1
- Can I use the wordpress loop in pages?
- Add addtional page parameter before loading the page
- When would it be best to hook AJAX functions on a back-end page?
- Get largest page id by title?
- How to insert current user ID in a shortcode?
- Make wordpress pages accessible for Woocommerce logged in users only
- Author information on all pages
- Display inner pages like posts.[Like how post excerpt works]
- include exception inside theme for empty widget area
- My pages disappeared from the list
- Pre-populating new Page creation with shortcodes
- WordPress Pages “allow comments” meta option can’t be checked
- How to display time when page is created and edited
- Loading internal page
- Firing page_publish where page is child page
- Page loads all pages of the image gallery with pagination
- Group Pages based on Parent in Admin Area
- Google indexed pages for one page site
- How to exclude page in pages module
- get id custom tables on current page
- static page with buton that opens collect email form
- Parent for a single (single.php)
- Create a new page for each form selection
- Multiple WordPress Pages
- How to create an user defined page?
- How can one get page by pagename if it is a child page?
- Archive with specific keyword by category sorted by date
- How to pass the Querystring in pages?
- Is it possible to keep the page title from actually appearing at the top of the page?
- Edit the text location of a form
- Missing page on wordpress “Pages” dashboard [closed]
- Split Page Links
- Ask for template when adding a new page
- How to view front-end of WordPress website, using Atom?
- I reached halfway through a WordPress tutorial to find out I began wrong for a new comer to WP
- Custom template is not showing up in templates dropdown list after re-naming it