Last active
October 9, 2024 00:35
-
-
Save braddalton/8922c98d77afbfda72cb to your computer and use it in GitHub Desktop.
Single Post Type Template http://wpsites.net/wordpress-tips/load-single-template-from-plugin-for-different-post-types/
This file contains hidden or 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
| add_filter( 'single_template', 'wpsites_single_post_type_template' ); | |
| function wpsites_single_post_type_template($single_template) { | |
| global $post; | |
| if ($post->post_type == 'post' ) { | |
| $single_template = dirname( __FILE__ ) . '/single.php'; | |
| } | |
| return $single_template; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment