0
votes

I'm attempting to setup a custom template for all posts under a specific Custom Post Type, using the Types plugin. I've looked extensively through their documentation and spent a good while attempting to find results on Google but can't find anything.

The recommended single-[name].php setup isn't working/taking effect.

Is there something I'm missing? Some custom code for my functions.php file?

Please advise.

Kind regards, Patrick

1
The [name] should be the name of the post type in the backend. This is often NOT the same as the name in the frontend. You're going to need to figure out how the Types plugin prefixes the post type name/slug that it registers. - rnevius
On second thought...what is the slug/URL of one of the posts with this custom type? - rnevius
Hi Rnevius, the URL structure is; /casestudy/postName. So I need to create a post template for all posts under the 'casestudy' category/post type. - Patrick Kelly
And you tried making a single-casestudy.php template? - rnevius
Unfortunately; yes. It didn't appear to take effect however. - Patrick Kelly

1 Answers

-1
votes

single-your_post_type.php should be called, if it is a single post of your_post_type. I suspect that one of the two conditions is not met. Place the following code at top in header.php and check the debug-output.

echo is_single() ? 'single' : 'not single';
echo ' : ';
echo get_post_type();

It is possible to alter the default template hierarchy with i.e. the 'single_template' hook. Check whether there exists such a filter:

echo has_filter( 'single_template' ) ? 'there is one or more single_template filter' : 'no filter exists for single_template';