Please try with the wordpress in build function
get_page_hierarchy( $posts, $parent )
Reference URL : https://codex.wordpress.org/Function_Reference/get_page_hierarchy
Related Posts:
- Can multiple custom post types share a custom taxonomy?
- How to Add Custom Fields to a Custom Post Type?
- Using save_post to replace the post’s title
- How do I safely change the name of a custom post type?
- limit selection of custom taxonomies to one?
- why doesn’t the_content() work in this {single-custom_post_type.php} page?
- $wp_query->queried_object->ID throws warning: Undefined property
- Load custom posts with same tag as page
- Hiding Custom Post Type from Google?
- functions.php conditional tag only for custom post type
- Get monthly archives for custom post type
- How to get dynamically custom post type that are under a certain category
- How do you modify the ‘post_parent’ of a custom post type?
- How to show related posts by category or custom post type?
- Custom Taxonomy returns no posts
- Display taxonomy term only if there’s a value
- Custom template for post type not working
- Custom/separate categories for custom post type
- How to delete all posts from a custom post type?
- Frontend posting – everything saves other than checkboxes?
- Update content of multiple pages/posts at once?
- Query custom post types and a specific page?
- Page as a child of a Custom Post Type
- Custom post types and permalinks
- using add_role function to make some users to create a selected type post
- Fetch taxonomies by custom post type id array
- How to retrieve category NAME instead of ID in a function with a taxonomy custom field?
- Change URL of posts and also Custom Post Type
- Normal pages as children of my Custom Post Type
- Diplay content from custom type as widget or sidebar?
- Custom post type and taxonomy slug issue
- WooCommerce product search titles only
- Related posts in all categories of current post (custom post types)
- Cannot save Checkbox meta box value from a Custom Post Type
- Custom Post Type template stored in plugin folder not showing in post attributes dropdown
- Sorting custom post type columns with external data and without meta values
- Change Slug in URL of Posts of custom post type
- Add a button or image button that calls wp functions in the wp-admin
- Custom post ui plugin & WP_Query – Polylang
- How to add a post slug to a url?
- Change CPT archive title
- Adding custom post type to count in category
- Custom Permalinks with CPT and Hierarchical Taxonomies
- Canonical url differs from custom post type archive URLs
- Custom post type archive page for multiple post types
- Invalid argument supplied in register_taxonomy $args->taxonomies
- Ignoring slug capitalization on rewrite rule for custom post type archive page
- Add the post type to the title of the page
- How to sort posts in a custom post type by title in ascending order by default?
- category page for custom post type
- Getting the taxonomy
- Custom post types: change “read more” text
- Getting Un Wanted Gallery Shortcode In The Page on Loop
- Custom post type sorting: alphabetical order
- What’s an efficient way to change the post status of many posts at once?
- How do I know if a rewritten rule was applied?
- How to handle new post from API request?
- Widget Categories shows “No categories”
- Custom Post Type permalink without /%day%/ and/or /%postname%/
- How to get Custom Post Type with Categories wise in WordPress using wp_query
- Sum a custom field that has a shortcode in it
- WP_Query of a custom post type isn’t working
- Roles and Capabilities in Custom Post Types
- How to create a master without relying on posts table
- How to reorder categories for Custom Post Type
- Exclude a specific post in a Custom Post Type
- Title and URL Error in Breadcrumb Navigation for Custom Post Types
- Filter result of Custom Post Type using meta_query with ACF
- How to properly set the rewrite rules for this case?
- Assigning categories to custom post types via a front-end form; only works for native post type
- Custom sorting in post columns by ACF Pro Select Field
- wp_post_delete is deleting all offices
- How to disable the editing of the time and date published for particular post type only?
- What is WordPress Way to Add Content Blocks to Post and Reference them as Many to One Relationship?
- Why can’t I filter my CPT shortcode by category?
- current-post-parent for custom post type
- Custom taxonomy template for custom fields loop [closed]
- WordPress page not showing up – replaced with last 10 posts?
- Displaying image instead of post label in wordpress
- Meta Box not being added in plugin
- Custom post order when using OR relation
- Amend posts using wp_insert_post
- WordPress custom post type
- How to have working breadcrumbs with several taxonomies associated with a custom post type
- Custom Post type archives / categories give 404
- Sorting on Taxonomy in archive page
- Redirect preview single post link to a page
- Yearly Archive from a custom date metabox (Event Start Date)
- Custom options for a Custom post type
- How to Display Custom Taxonomies in an Un-ordered HTML List
- 404 with Custom Post Type
- Custom loop won’t work, can’t find problem
- link posts to custom post type
- Knowledgebase / Docs: Custom Post Type, Pages or as a Post Category?
- Add top-level menu pointing to a different custom post type?
- custom post type not getting archived?
- Most appropriate way to display CPT’s by children terms of custom taxonomies while retaining desired permalink structure?
- See the process of creating a taxonomy and tell me where I made a mistake
- Google Analytics Dashboard for WP in Custom Column
- Navigation won’t update to show full path to single post