Archived topic
Custom template for CPT
3 replies · Started by Daniel on July 5, 2016
Hi Tom!
I have created a CPT and I need it to use a custom template for displaying content.
I've used custom templates before but I can't figure out how to assign it automatically to the appropriate CPT.
Also, I think I should customize single.php and content-single.php as both are involved in displaying single post content isn't it?
So, is it some function I can use in order to make CPT "mycpt" use "mytemplate" instead of choosing it manually everytime I add another entry?
Thanks in advance!
Hi Daniel,
It's all about how you name the file.
Take a look at this: https://codex.wordpress.org/Post_Type_Templates
Thanks Tom!
That was just what I needed.
You're welcome :)
