简体   繁体   中英

Single post template for specific Custom Post Type using Types plugin Wordpress

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

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 ie 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';

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM