You could do (untested):
if( get_post_type($post->post_parent) == 'apples' ){
get_template_part('single-apple-child')
} else {
/* the rest of your current single page */
}
Though there may be a better way!
Related Posts:
- How to use a custom post type as front page?
- Querying Posts by Taxonomy From Alternate Network Site
- Query by 2 values of a repeater ACF field
- Comparing timestamps in meta query doesn’t work
- Display two post types ordered by two custom fields
- Include both default and Custom Post Type in query modified inside pre_get_posts
- Having trouble with custom date field for CPT query (WordPress)
- WP_Query search posts by custom post type and custom taxonomy
- Calculating Bayesian average for custom post type
- Conditional to modify query results
- Is it possible to create a shortcode that will query a post based on taxonomies?
- Querying Term Posts in Loop
- Use get_post_types to query only custom posts types
- WordPress Orderby Numeric Value Not Working
- convert custom query to wp_query
- Search / Filter posts on Title/Content OR Tags
- creat filter with wp_query
- First custom field value (out of several) displayed twice after query
- Prioritize posts in query by meta keys?
- WP_Query orderby and tax_query
- Different Ways to Query Custom Post Types?
- Showing specific post in order of array wp_query
- WP_Query() with custom post type and taxonomy — get all terms?
- Returning a custom content types with meta values
- Create query for both custom post type and category
- Query custom posts from custom taxonomy
- Make Next and Previous on single-$posttype.php use the same order as archive-$posttype.php
- Is there a (preferable built-in) way to check what custom queries are used in a theme?
- Change search query in wordpress custom post type
- WP Query from two Custom Post type fields as statement
- WP Query: If field X is empty, show posts based on field Y
- How select query is generated in a Custom Post Type?
- WP_Query for custom taxonomies showing posts from non-specified terms?
- WP_Query with all posts in one custom post type and only posts in another custom post type with a specific category
- post type => ‘any’ not applied my custom queries
- Linking posts together with Advanced Custom Fields “both ways”
- Get posts of an specific term of a custom taxonomy
- Conditional posts in WP_query for search
- Query Pulling the same post twice
- Is it possible to add query parameters on the archive page?
- Custom post type single display is ommited
- Query Posts From Multiple Post Types
- WordPress can only query up to 766
- Filter Custom post type by another Custom post type
- Create a list of months based posts
- Load posts via AJAX without draft status
- Get post with multiple meta keys and value
- Get posts for custom post type with WP_Query
- Number of pages – multiple (custom) post types
- Enforcing canonical URLs with multiple custom post types
- WP_Query -> sort results by relevance (= most tags / taxonomy terms in common)
- how to group custom post type posts by custom taxonomy terms
- wp_query and comment_parent – select only posts with top level comments
- List all custom post type posts from a given category?
- Automatically adding meta data to posts or multiple query help
- Loop on front-page.php
- Can’t get order_by meta_value_num to work properly
- orderby in custom WP Query does not work
- Am unable to reset a query properly
- Linking to the most recent post in a Custom Post Type
- Creating a navigation menu of all posts of a custom post type and their children posts?
- I am trying to hide a custom post type category to logged in users with Pre_Get_Posts
- WP Query post__in not returning correct results
- Proper way to display latest 5 posts grouped by post type?
- Detect inside a custom query the kind of post type to assign custom classes
- Query multiple taxonomies with pre get posts
- get_pagination not working on a custom post type query (using WP_Query)
- WP_Query with custom post type ID
- Query all post and CPT from 2 specific taxonomies AND by ACF custom field
- Can’t access private custom posttype single- or archives-page
- postsperpage value not being applied
- Exclude latest post from WP_Query taxonomy term loop
- Getting titles from an array of IDs
- Display featured posts for a custom post type by taxonomy
- What is the most efficient way to execute recursive complex queries?
- date_query empty results with custom post type
- conditional filter
- Give active class to current page on a while loop WP query for custom post types listing
- display post count in archive page that have relation with another taxonomy term
- How can I sort the results of a REST API response by the title of a connected custom post type?
- Query when is one or several values
- Use WP_query to match post types based on custom field values
- Post Filtered by Custom Field Value
- Retrieve custom post by a query on one of its custom fields
- Orderby modified only for specific post types
- Checking Taxonomy Terms for a Custom Post Type With get_the_terms Not Working
- Display year value before a set of posts
- Query Event Posts by Date
- How can I pull information from my loop and divide them seperately?
- Retrieving IDs of child pages which are in a different post type
- Conditional Tags If Custom Post Parent & Child?
- Post content stays the same but permalink changes ?
- Pagination not working with custom loop
- Using tax_query to get single post per category
- Show Posts in Vertical Tabs with Scrollbar
- How to manage wordpress knowledge base/wiki/posts collections
- Is it possible to make is_category() recursive?
- Get X posts with the same terms as the current post (custom post type and custom taxonomy)
- Default WordPress Query for a Specific Custom Post Type URL
- Dynamically count the number of custom post types associated to a custom taxonomy