Undefined constant with debug set to true
I have used to following code to change the location of ‘single’ WordPress templates. define(SINGLE_PATH, TEMPLATEPATH.’/single/’); add_filter(‘single_template’, ‘lsmwp_custom_single’); function lsmwp_custom_single($single) { global $wp_query, $post; if ($post->post_type == “cpt_operator”){ if(file_exists(SINGLE_PATH . ‘/single-‘ . $post->post_type . ‘.php’)) return SINGLE_PATH . ‘/single-‘ . $post->post_type . ‘.php’; } foreach((array)get_the_category() as $cat) : if(file_exists(SINGLE_PATH . ‘/single-cat-‘ . $cat->slug . ‘.php’)) … Read more