Troubles with making a custom template for posts

Is it possible to make a template for all posts in a custom post type? For example I would like to be able to change an adsense ad or some other element on every post by simply editing a custom template.

I have been experimenting with templates that are pretty static, but I am stumped on which one to copy/edit for the posts.

Related posts

Leave a Reply

2 comments

  1. Yes it possible, take a look at Template Hierarchy codex entry to get a better idea but the simple answer is to create a template for all of you custom post type posts
    create a template and name it single-{post_type}.php so if your post type is named dogs then your template file should be named single-dogs.php and automatically this template file will be used to display all of the dogs post type posts and once you edit that file it will effect all of the posts of that type.