Quantcast
Channel: WordPress.org Forums » All Topics
Viewing all articles
Browse latest Browse all 67836

add_filter single template not working

$
0
0

Replies: 0

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 ‘http://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. http://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)


Viewing all articles
Browse latest Browse all 67836

Trending Articles