I am trying to: add a template for single.php for new type
Link to a page where the issue can be seen: hidden link
I expected to see: the template i defined
Instead, I got: the theme single.php template of every post
Content Templates or Template Layouts replace the_content() part of the template which is created by the Theme.
If your theme does not use the_content(), but another specified function to render the Post Body, you can add it to the Toolset following this doc:
https://toolset.com/documentation/user-guides/theme-support-for-content-templates/
This will only work for Content Templates, not Template Layouts
If your theme uses a not-supported custom filter or function then you cannot replace its content with the Templates of Toolset.
That is elaborated here:
https://toolset.com/home/compatibility-toolset-plugins-themes/ > Problem with themes that do not use the_content() to render Post Body Content
If your Theme is using a supported content function, you have assigned a Content Template or Template layout to the content as shown here (https://toolset.com/documentation/user-guides/view-templates/), then I will need the precise link to the templates, the posts, and access to the Website as Admin to see what is wrong.
The output of debug is
Content Template debug:
Calling functions are Bunyad_Posts::the_content, WP_Hook::apply_filters
You can see it hidden link
I just disabled filters on my custom type post and still doesnt show my template
function wphats_remove_plugin_filters() {
global $post;
if ( 'package' == $post->post_type ){
//remove_all_filters( 'the_content', 'bunyad-shortcodes' );
remove_all_filters( 'the_content' );
}
}
add_action( 'wp', 'wphats_remove_plugin_filters' );
The content rendering function is apply_filters() which is not an allowed method to render the content, as the very Settings Screen in Toolset > Settings will explain.
Unfortunately, this means this theme is not ready to be used with any other content rendering plugin but only with its own content rendering function.
I am not sure who from Toolset Support suggested the function you shared - however that won't solve the problem.
The problem is that this theme does not follow WordPress standards to render the content.
You can solve that by creating a Child Theme, then in that Child Theme you can create templates for single posts and in it, call the_content() or any other custom, dedicated function to render the content (but not apply_filter() or any of the other forbidden functions as shown in the Toolset > Settings).
Here you can find more details about how to create a child theme:
https://developer.wordpress.org/themes/advanced-topics/child-themes/
Can I ask what theme you use?
I might then try to reach out to them, however, this should usually be done by the user in this case (you), since it's not that there is a BUG or compatibility issue to solve, the only required would be for the theme to use a WordPress standard function to render the content.
Note, this issue will happen with any other plugin that works on the_content() and that theme.