post_parent is a numerical value field in $post object. So you should check if there’s a valid number. Try this –
<?php if ( $post->post_parent > 0 ) { ?>
the child single-artists.php
<?php } else { ?>
the parent single-artists.php
<?php } ?>
Related Posts:
- Conditional for single-{post-type}.php
- is_singular() not working if called via callback function of admin-ajax.php
- How to disable the single view for a custom post type?
- Custom post type single page returns 404 error
- Single custom post type page redirecting to 404 page
- Disable Single Post View for Specific Taxonomy on Custom Post Type
- functions.php conditional tag only for custom post type
- Get template part based on custom taxonomy term
- How to get a list of term names of the custom post type im currently on in single.php
- is_singular won’t call my functions?
- Create sub single pages
- If on term-page -> get the current term?
- Using previous_post_link and next_post_link to wrap around post sequence
- How do I create new content pages for my Custom Post Type?
- Display “Post 2 of 4” on single post page?
- posts_nav_link on single post template
- changing default comment form arguments [duplicate]
- Custom template for post type not working
- Make custom post type display as a page
- Disable single view in register_post_type [duplicate]
- Archive page for custom post type not working
- pagination redirecting from page number url before page requested
- if custom posts type exists and there are posts load script
- How to check the terms in single custom post type template
- How to show the archive / post type description on Single templates
- Need to display same custom post type on 2 different singles templates
- Made Custom Post Types, but single.php not working
- Posts of custom post type load the page template
- Need help targeting a custom post type with conditional tags
- Why would this IF statement not work? [closed]
- Custom post template for particular posts
- custom comments on specific post type
- Excluding custom post types
- Single Template that can be applied only via URL
- How do I display tags for a custom post type single page?
- Custom post type not displaying content from single-{custom post type} page
- Register widget only page is a singular of custom post type
- custom post type parsed as attachment
- Conditional Query of Custom Post Type and custom taxonomy
- Programmatically rewriting slug through functions.php but returns 404
- How to display single post from custom post type loop?
- Setup template_redirect using has_term when NO term assigned
- How to run filter only on custom post type edit screen
- Conditional statement for if archive page has posts which contain certain taxonomies/categories/tags, show those terms
- Custom Post Conditional for Parent & Child Single.php?
- Single page not working for custom post type
- Conditional for a Single Post That Belongs to a Category?
- single-{post_type}.php not working
- Get term name without a foreach loop
- How to show only the most recent post on my custom post type archive?
- Associate page w/ specific single post template?
- Display custom post types in wp_list_pages
- Conditional Tags for specific category of custom posts
- Move Genesis Single Page/Single Post Title
- How to check if post/page or taxonomy post is published by admin
- TinyMCE Buttons on Certain Post Type
- hide specific div on single.php [closed]
- Display message if no posts in Custom Post Type loop
- How do I find a way to create a global single.php for a custom post type?
- How to use single.php for creating, reading and editing Custom Posts with ACF
- Can’t access private custom posttype single- or archives-page
- trying to show single post but displays all post on a custom post type
- Custom Post Type Specific Post Template
- Redirect to URL if x number of days passed
- comments hooks on custom post type
- If custom taxonomy else conditional [closed]
- Show specific content on parent custom post type and all children
- Make Next and Previous on single-$posttype.php use the same order as archive-$posttype.php
- Use conditionals with wp_enqueue_style to attach stylesheet according to post type displayed
- Conflict in function to allow single post template based on category
- Give active class to current page on a while loop WP query for custom post types listing
- Loop all post on single.php
- Custom post type single page 404
- custom post type – project link output via single-portfolio.php
- get_the_terms child terms for current post/custom post only
- Shortcode and get_template_part
- Why custom post redirecting to index page?
- How to make “single post” permalink maintain it’s sub-page structure
- custom post type single page
- custom post type single post preview for pending status
- $_SESSION Not working after X amount of page views
- How to show data content from single page which is from custom post type?
- How to get adjacent_post custom_field value
- How to set class to “current-page” on the currently viewed single post within a CPT
- DIVs not showing correctly on CPT?
- Display Taxonomy Term for CPT on single-CPT.php
- How to display category wise posts on seprarate template
- Can not hook into custom post type template with: is_page() conditional?
- Pulling in Related Posts based on Post Type array
- Custom post type single display is ommited
- Single page problem when permalink type changed
- how to load custom single.php?
- Single Page for two custom post types
- Query child posts on parents single.php?
- Custom Post Query Combined with Conditional Tags
- is_singular won’t call my functions?
- Conditional statement checking two conditions for CPT and Custom Taxonomy [closed]
- strange conditional tag behaviour [duplicate]
- Can I have a specific template for products even if they are standard posts and not CPT?
- Custom post type is_singular condtional not working when managing sidebar display