How do I Make a custom post type get a custom post template in a plugin
function get_custom_post_type_template($single_template) { global $post; if ($post->post_type == ‘events’) { $single_template = dirname( __FILE__ ) . ‘/single-event.php’; } return $single_template; } add_filter( ‘single_template’, ‘get_custom_post_type_template’ ); Source Or you could use: add_filter( ‘template_include’, ‘single_event_template’, 99 ); function single_event_template( $template ) { if ( is_singular(‘event’) ) { $new_template = locate_template( array( ‘single-event.php’ ) ); if ( ” … Read more