template_redirect for single posts w/ custom fields
The problem with your code is that you’re checking is_single() when your plugin is first loaded, before the global query has run, so is_single() still returns false. You should move the is_single() check within your my_template function: function my_template() { if(is_single() && have_posts() && ‘Custom’ == get_post_meta(get_the_ID(), ‘Design’)) { include(PLUGINDIR . ‘/supersqueeze/all.php’); exit; } } … Read more