Skip to content

Instantly share code, notes, and snippets.

@rachelbaker
Created September 2, 2012 18:53
Show Gist options
  • Select an option

  • Save rachelbaker/3603101 to your computer and use it in GitHub Desktop.

Select an option

Save rachelbaker/3603101 to your computer and use it in GitHub Desktop.
Display WordPress plugin template file for custom post type
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