Created
September 2, 2012 18:53
-
-
Save rachelbaker/3603101 to your computer and use it in GitHub Desktop.
Display WordPress plugin template file for custom post type
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
| public function get_project_cpt_template($project_template) { | |
| global $post; | |
| if ($post->post_type == 'projects') { | |
| $single_template = dirname( __FILE__ ) . '/views/single-project.php'; | |
| } | |
| return $project_template; | |
| } | |
| add_filter( 'project_template', array( &$this, 'get_project_cpt_template' ) ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment