What’s a page template?

Your theme will set up the font, the colors, and how your header and footer look. Your theme can have a predefined structure for your blog posts: your blog content to the left, a list of recommended blog posts to read on the right, and a comment section at the bottom.

These are page templates: a predefined structure that can be applied to your post types. They can be applied to your posts, pages, or any custom post types.

By creating WordPress templates, you can apply them to any page or group of pages on your website. Therefore, you can also change your overall web design without manually updating every page.

While you can only easily edit it natively with some knowledge of PHP, there are certain tools to create templates for your website.

Templates will be especially useful for your custom post types, for example. For example, your product pages, so you don’t have to manually create every single page for every item in your stock.

While page templates can be used to display static content, such as pre-defined text, they are more useful to display dynamic content. 

Need help to remember what it is? Remember to watch the lesson “Posts, Pages, and Themes: making a sense out of it”.

So you can have a space and set it to display “product’s description”. This field will auto-populate with the current product description the user is visiting. The same applies to images, titles, reviews, comments, etc.

Most themes come with some simple templates, such as an option with a sidebar (like the blog post mentioned before), or without a sidebar on it (also named full-width page), or even a template that ignores the header and footer settings, called a blank template.

For example, if you are a photographer, you might want to enable the option to enlarge pictures when people click on a photo. Or, for an online school, an option to display a promotional video of the current course, and so on.

This feature, and many others, can be achieved simply by using a template, instead of having to code it into every single page manually.

Pay Attention: Sometimes, when a plugin creates a custom post type for your WordPress installation, your theme may not contain a template to accommodate this new custom post type. Thus, your page will look unstyled. That’s why it’s important always to check if your desired theme is compatible with a plugin.