This is more of a clarification question, but if I don't have a single-CPT.php
script in my child theme, then will all my CPTs default onto single.php
? I am just wanting to clarify more than anything. It appears that way on my local dev, but I thought this wasn't the case?
1 Answer
Yes, they will.
You will find the WordPress template heirachy useful, particularly this graphic:
This shows how the templating system works - in particular, how WordPress will select the most specific template it can find, with fallbacks to the least specific (eventually, to index.php
).
In your case, you'll see in there that single-$posttype.php
falls back to single.php
, then singular.php
, then finally index.php
(direct link to single post section of docs).