Skip to content

Instantly share code, notes, and snippets.

@Shelob9
Created June 19, 2014 16:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Shelob9/176f9b6bf98ac8f44e83 to your computer and use it in GitHub Desktop.
Save Shelob9/176f9b6bf98ac8f44e83 to your computer and use it in GitHub Desktop.
<?php
//**Set name of custom post type in $custom_post_type
$custom_post_type = 'NAME_OF_POST_TYPE_HERE';
if ( is_singular( $custom_post_type ) ) {
$part = $custom_post_type;
}
elseif ( is_page() ) {
$part = 'page';
}
elseif ( is_singular() ) {
$part = 'single';
}
else {
$part = null;
}
get_template_part( 'content', $part );
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment