display different template based on post type

Hay, i have a custom post type "Events", however this is basically a post type, so it inherits the post.php template page.

Is there anyway to use a different template (i.e events.php) if the content type is an 'event'?

Answers 2


  • This is why using the custom template files that you can use like page-{post_type}.php and single-{post_type}.php are extremely handy. And in 3,1, archive-{post_type}.php too.

    So yea, you just create a template file for your post types, using the custom templates like that instead of the way where you put the template name in a comment at the top of the file. That way sucks, and I never ever use it, and I create post types like maddness.


Related Questions