Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

WordPress

devin schumacher
devin schumacher
1,820 Points

Page templates vs. custom post types?

Can you create multiple "page templates" for every "page / post / custom post types"?

3 Answers

Hi Devin

You can create as many page templates as you like, they can have individual specificity or they can be a group of specific pages, so generally a page template will be used for the general look and feel of the page, the structure and layout.

A custom post type on the other hand is essentially a custom group of items, the same as you have pages, posts, archives, etc, all of these are default post types that can be displayed on your website, so its slightly misleading being called a post type as its not actually referring to a "post".

  • So page templates for structure of the page. (grid, sidebar, comments, etc)
  • And custom post types when you want to create a completely different post type than the default. (movies, store, etc)

here are the default post types

This image is slightly overwhelming at first but it shows the hierarchical structure of WordPress very well

Hope this helps

devin schumacher
devin schumacher
1,820 Points

Thanks Liam.

Sounds like I need to learn about how to create additional page templates. Hopefully this is covered in the WordPress Dev course!

Although the TreeHouse courses are great for general knowledge, the WordPress Codex and developer handbook should be your best friend, theyre extremely helpful and they have every thing you could possibly want to do, fully documented.

Here’s the link to the page template on the codex

And here’s the developer handbook for page templates

In my opinion, reading up on these two pages will be more beneficial giving you the in depth knowledge you need.

Good Luck!