add_filter single template not working
-
I set up here
add_filter(‘single_template’,’event_cpt_custom_template’);
function event_cpt_custom_template($single)
{
$fl=get_site_url().”/wp-content/plugins/twsEvents/template/single-cpt.php”;
return $fl;
}this code should then go to my single-cpt.php code
print ‘https://twsdev.co.uk/corp/event/another-champagne-breakfast/‘;1. my single-cpt.php code works at that address if i call it directly
2. event_cpt_custom_template is being fired fine
3. https://twsdev.co.uk/corp/event/another-champagne-breakfast/” is the permalink of my custom post
4. On clicking on the link, it displays the post using the single.php default not my single-cpt.php code (which displays It works! and exits when run)
- The topic ‘add_filter single template not working’ is closed to new replies.