Created
April 18, 2020 11:34
-
-
Save shaddam/27d4cd022f0d7f55b8acf2d57637cc98 to your computer and use it in GitHub Desktop.
Custom Post Type Single Templates from Plugin Folder
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
| /* Draw Constructions single service template */ | |
| function draw_cons_single_template_modify($single) { | |
| global $post; | |
| /* Checks for single template by post type */ | |
| if ( $post->post_type == 'draw_cons_service' ) { | |
| if ( file_exists( DRAW_CON_PL_PATH . '/single-draw_cons_service.php' ) ) { | |
| return DRAW_CON_PL_PATH . '/single-draw_cons_service.php'; | |
| } | |
| } | |
| return $single; | |
| } | |
| add_filter('single_template', 'draw_cons_single_template_modify'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment