Created
June 16, 2014 16:17
-
-
Save abhilash0001/ce1c9e155137d6087236 to your computer and use it in GitHub Desktop.
Wordpress | Custom post types
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
/* ========================================================================== | |
If you are a big fan of keeping your code base clean, you can place | |
the code below in the functions.php for custom posts single template | |
========================================================================== */ | |
function get_story_post_type_template($single_template) { | |
global $post; | |
if ($post->post_type == 'story') { | |
$single_template = dirname( __FILE__ ) . '/page-templates/single-post-templates/single-story.php'; | |
} | |
return $single_template; | |
} | |
add_filter( "single_template", "get_story_post_type_template" ) ; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment