Created
March 16, 2016 12:54
-
-
Save joecue/a20995829e79e8e7b2be to your computer and use it in GitHub Desktop.
WordPress - Theme file in Plugin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function my_event_template($single_template) { | |
global $post; | |
if ($post->post_type == 'event') { | |
return dirname( __FILE__ ) . '/single-event.php'; | |
return $single_template; | |
} | |
add_filter( "single_template", "my_event_template" ) ; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment