wp_list_pages
calls get_pages
internally and pass the argument list to get_pages
so you can pass arguments whatever get_pages
accept.
To display child posts on your single-{post_type}.php
you need to call wp_list_pages
with post_type
parameter.
wp_list_pages
will ignore post_type
but it will pass this to get_pages
.
Example:-
echo '<ul>';
wp_list_pages(array(
'post_type' => 'show',
'child_of' => get_the_ID(),
'title_li' => false //Set to false to disable the heading
));
echo '</ul>';
The only benefit of using wp_list_pages
is hierarchical display in case if you have grandchildren of a post. get_pages
with foreach
loop will always give you flat list regardless of child or grandchild.
Related Posts:
- How To Limit Hierarchical Pages Depth (For Custom Post Types) To Children Only
- Automatically create child pages when saving a (parent) page
- Display a list of child posts on parent posts of a custom post type
- 404 on child page when parent page slug is identical to custom post type
- Create child page within custom post type
- Custom Post Type Permalink For Parent/Child, 404 Page Not Found Error
- Display posts of custom type in hierarchical order
- Query in a Hierarchical Custom Post Type for Children vs Siblings
- Child page in custom post throws 404 page not found
- Custom post type hierarchical permalinks not behaving as expected for parent/child pages
- Remove custom post type slug not working for child pages
- Share parent path between Custom Post Types and Pages?
- Page as a child of a Custom Post Type
- Can I make WordPress use a custom template for a child page
- Custom rewrite rule for hierarchical custom post type
- List children on child post
- child of post type (custom)
- Child post with numeric only slug keeps redirecting to parent
- Next and Previous Posts of Same Parent
- Display Child Pages of Custom Post Type Parent Page
- Versioned Custom Post Type (Not the same as revisions)
- Custom post Type, child of a Page?
- Removed custom post type slug but not working for child pages
- List of child custom post types lists all custom post types
- Redirect to first child on Custom Post Type (without template)
- Query to get child pages of current page and display it in action hook
- If/Else child list for Custom Post Type single template within loop?
- Migrate Custom Post Type with Custom Fields data and parent child order
- How do I find out which (page) template file my custom child post is looking for?
- How to use POST method using custom wordpress button?
- Standard Page Child of CPT Not Found (404)
- Display a list of sub-pages of Custom Post Type Parent Page
- I have a problem with displaying children pages of custom post type
- WordPress custom post type and page
- Child Theme problems
- Custom post type child page 404
- Custom Post Type Child Pages
- How can I give WordPress child custom post type the same title and slug as its parent?
- Exclude from search all custom posts which are NOT in a taxonomy term
- Remove tabs from media uploader for a CPT
- Remove unwanted part of permalink custom structure from CPT url?
- Changing a custom post type “has_archive” after registered
- Custom Post Type pagination when CPT ‘rewrite’ rule and a page have the same slug
- wp_insert_post custom taxonomy
- dynamically update permalink and title with the values of custom fileds
- Append taxonomy terms as class names in markup?
- Getting a “Changes you made will be lost” dialog prompt on a custom post type page
- Custom Post Types vs Database Table where many (10,000s + ) of entries are possible/desirable
- Different Archive and Single Permalink URL
- How to remove slug metabox from custom post type’s page?
- Trying to edit the single page from a Custom Post
- is there a way to retrieve posts that do not have a featured image assigned?
- How to structure sales of reports [closed]
- Why does querying on post_tags (which has been applied to custom post types) only return posts?
- Custom Taxonomy Permalinks Redirection
- Undefined Variable – Custom Post Type Meta
- shortcode to show custom post types by category
- Custom post type archive page template
- Use a hierarchical custom post type for a main blog and subblogs?
- get custom post type
- WordPress Custom Fields Won’t Save
- Getting meta in editor plugin, and event triggering issue
- Display a grid of taxonomy terms at root taxonomy page
- Only show post if Author matches Logged in User
- How to change permalink to include custom post type
- save_post custom post type ? $_POST not working?
- Change the Custom Taxonomy URL Slug pattern
- Load Next WordPress Posts With AJAX?
- Implementing Pillar Posts; Long Posts yet with Some Page-Like Handling?
- CPT Columns doesn’t show categories
- Custom Post Type “MUST NOT” be able to search via URL
- Custom taxonomy template list not working (404)
- Query for post and costom post_type in same category filtered by meta for post_type
- List latest post out of 2 custom post types
- Adding custom post formatting options in custom post types
- Adding Page Ordering to a Custom Page Type
- How to properly use Categories with Custom Post Types
- Better in the long run to use post date or custom taxonomy to sort/separate posts by year?
- One Custom Post Type two different Templates
- On click some element i want to use some template
- Remove custom taxonamy slug with pagination
- How do I link to a dynamic ACF button from a Custom Post type?
- Hook create / update post
- Show Post columns to specific users on condition
- Custom Taxonomy – fields
- CPT Loop, include taxonomies and disclude others?
- How to use costum database table for custom post type
- connect users to Custom post types
- Making my custom column sortable
- date_query won’t accept day parameter, but will accept month and year for a custom post
- the_permalink() leads back to homepage
- Custom Post Type Pagination Not Working or Single Posts Displaying?
- Category / Custom Post Type permalink issue
- is_singular won’t call my functions?
- loop through custom post-type with two meta_keys
- How do i make a listing page of custom post type?
- How to add post type in masonry posts elementory widget
- How to exclude certain portfolios from a loop
- Custom Post Type urls not working
- Just the First Metabox what saves the data!