WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
up vote 3 down vote accepted

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.

share|improve this answer
Wow fantastic... that was fast :D It's amazing how much information is in the Codex, and yet I consistently fail at finding it :) – SkinnyGeek1010 Mar 31 '11 at 0:44

This image is invaluable; make sure you print it out and keep it around your desk:


share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.