add_filter(single-{CPT}_template
-
Good Afternoon,
I’m having an issue where the filter for the CPT template callback is not getting called but if I put any old post type in there like ‘single_template’ it’s getting called just fine.
Any idea why?
Thanks!
register_post_type('stoneblue-thinkific', $rpt_arg);
$this->loader->add_filter('archive-stoneblue-thinkific_template', $plugin_public, 'archive_stoneblue_thinkific'); $this->loader->add_filter('single-stoneblue-thinkific_template', $plugin_public, 'single_stoneblue_thinkific'); $this->loader->add_filter('single_template', $plugin_public, 'single_stoneblue_thinkific'); $this->loader->add_filter('archive_template', $plugin_public, 'archive_stoneblue_thinkific');
So for a single post and an archive it calls the cb and loads the template located in the plugin dir. But for CPT nada. The CB doesn’t get called.
The CPT is there, I can create new CPTs and see the list in the admin area wp-admin/edit.php?post_type=stoneblue-thinkific
That all works great just not able to load the CPT templates. Well I can load the CPT templates with single post and archive post types but not the CPTs.
- The topic ‘add_filter(single-{CPT}_template’ is closed to new replies.