And now we’ll start talking about the types of templates that you have. We saw that there are the number of templates in the template selector. Well, Thesis comes with 2 types of templates. The first are the core templates and core templates are automatically applied to the appropriate pages. Core templates correspond to WordPress templates.
Now it used to be the case or right up until now, it is the case that the only people who had anything to do with templates and WordPress were programmers. Because template choices were made for you automatically and the programmer came up with the templates and WordPress had its own standard system of selecting templates. And a regular person didn’t have interact with that in any way. Well, Thesis 2 gives you the opportunity to interact with that so now you have to understand something about templates. And the first is that the core template are automatically applied to the appropriate pages.
But custom templates are manually applied by the user. So when you create a custom template, the only time it gets applied is when you specifically apply that. So having said that, let’s look at the templates.
Your core templates are summarized here as home, single, page, and archive. Your home page template is always, absolutely always, your blog page. Whether you have a static front page or you’re letting your front page be your posts page, this home page template always only applies to the blog posts page. It will never apply to any other page. And no other template will ever apply to your blog posts page. So if you want to do something on your blog posts page, this is the template to do it in. And whatever you do in this template will only apply to that.
The next type of template is a single template. Now a single template refers to a single post. When WordPress started, WordPress was only a blogging engine. And so a single post was a single blog post and your home page was always you know, some number of your posts displayed. And you know, whether it was 10 or 100 or whatever, your home page always displayed your latest blog posts. And if you went to an individual blog post, you are going to a single blog post. That’s where these two terms are the way they are because WordPress started off only having blog posts and a homepage. And a homepage showed a collection of blog posts.
And then WordPress added pages. Well, when they added pages, they used the term page to distinguish pages from posts. And so single came to mean posts but not pages. Okay now single currently stands for either posts or any other post type. So for example, if you… and beginners probably don’t know anything about this but you can create custom post types and some plugins that you use will automatically create custom post types. And when you have a custom post type, those take the single template. And when you create a custom post type, when you have a custom post type, that post type will show up under single here. And you can… if you want to edit that post types template, it would be… it’ll be a child of the single post type.
Okay, page is something completely different and it’s only completely different because when they came up with pages, they figured there would only be 2 things. You would have posts or you would have pages and there would be nothing else. But obviously, WordPress has evolved since that. But nevertheless, its old system still stay in place. And so a page is a… in technical terms, a post type that is different than a blog post, different than a post. And your page template will apply to all of your pages where your single template will apply to all of your single posts.
Inside of page templates, you have the front page which is of course, another new thing. It used to be that the home page… the only thing your home page could be was your post page. And somebody came along and said, “Well you know, you might just want a plain old ordinary static page to be your home page instead.” And so WordPress came up with this mechanism for allowing you to have a static page as your home page and then they called it something. They called it a front page. And so this front page template always only applies to a static front page. It’s never going to apply to a blog page and it’s never going to apply to any other page. It will always only apply to a static front page.
Now if you don’t understand why you might have or how you would have a front page versus a blog page, this is something that you set up in your Reading Settings. Now I’m not going to really go into that too much. But under your Reading Settings here, you can determine whether your front page displays your latest posts, at which point, your home page is your blog post page. Or if it displays a static page and if it displays a static page, you’re going to pick your front page. And then you have to pick a page that’s going to be your posts page.
So in this context, my home page is automatically applied to this articles page and only that. My front page is automatically applied to this “Learn to Build A Website Just Like This Page”. And there’s nothing I can do about that nor is there anything I want to do about that. There wouldn’t be any reason for you to want to do anything. What you have is two different templates for these two things. If you want to do something on your front page, you’ll edit your front page template. If you want to do something on your post page, you’ll edit your post page template. If you have a configuration like this, you’ll see that you could still pick a custom template but that custom template selection will be ignored. Because the only possible template that applies to your front page is the front page template. The only possible template that will ever apply to your post page is your home page template. It’s just that simple.
Now the question is when you would use a single post versus a page is completely independent of Thesis. If you come over to your posts and you say Add New Post, unless you choose a custom template, it will automatically use the single template. If you come over here to Pages and you say Add New Page, unless you select a custom template, it will automatically use the page template. That’s why you have this automatic… that’s why I described Thesis templates or core templates as being automatically applied because the page template automatically applies to pages. Single template automatically applies to post and all other custom custom post types. The front page automatically applies to the… or the static front page and the home page automatically applies to the blog post page.
But we have one other kind of template that we haven’t talked about yet and that’s the archive. Now an archive page is any page that is a collection of posts that are grouped together. So the thing that people are most often familiar with is a category page. They say, “I want a category page.” And by that, they won’t mean they want a page that displays all of their posts that are categorized a certain way. Well, WordPress automatically creates those things for you. That is a fundamental WordPress function. And the archive template is the template that’s used for all of those things. So if you’re doing… a search results page is an archive template. If you’re using tags and you’re tagging posts and you click on a tag, what you are seeing is an archive template. The archive here does not mean you know, something that’s old that I’m setting back in the back. Archive means a collection of posts that are categorized or organized together such as they are grouped together.
Now, on my site an example of that is… let’s say a lesson subject. Now a lesson subject happens to be a custom taxonomy but nevertheless, it’s an organizing thing. And that organizing thing will, for example, it will show you all of the posts, pages, and custom post types on my site about installing Thesis. If you click on that, you get this archive page that shows everything about how to install Thesis.
Same thing is true with topics. Again, on my topics page, if you want to look at all of the posts and stuff like that on my site that talk about text widgets, then if you click on text widget, it’s going to show you an archive page that shows you every post that I have said is associated with the topic of text widget. That is what an archive page is.
Charles suggests that they should have called it collections. And you’re right, they should have called it collections. And in fact, there are some people who do call them collections. But the current canonical tem nevertheless is archive and that’s what Thesis uses. Okay so those are your archive pages.
Now it turns out, you can have a category archive page that’s different that your tag archive page. You can have a taxonomy archive page that’s different than your author archive page, so on and so forth. So you can customize these templates if you wish.
Now that brings us up to this question of parent child relationships and templates because you can… what you have here are parent templates and child templates. I want to use an example of the page here.
This page template is a parent template and it will apply to every page, the front page, and your 404 error page as long as you haven’t changed these things. So if you customize the page template, those changes will automatically apply to the front page and the 404 page until you say, “You know, I want that front page to be different.” Now as soon as you go in and change your front page, it no longer inherits everything from the page. The changes you make to the front page template aren’t made to your page template and aren’t made to your 404 error page.
Now the same thing is true with archives. Let’s say that you have… you want your category archives to be completely different than all the rest of your archives. Well, if all you have done is customized your archive template, those customizations will be reflected all the way through, all of your archives. However you customize your category template, that customization will not be reflected in the archive and it will not be reflected in any other archives. And from that point on, any changes you make to your archive template will not be reflected in the category template.
So that’s the way this sort of inheritance or parent child relationship works. If you don’t make specific changes to the child templates, the parent template will apply to them. If you make specific changes to the child template, that breaks the relationship so that changes you make to the parent will no longer be reflected in the child. And changes you make in the child won’t be reflected anywhere else but the child.
Now somebody notices that you can’t click on this front page template. Well, the reason you can’t click on the front page template is because the front page is active. It’s not clickable because we’re already there. These are hyperlinks that take you there. If I was on the page or let’s say if I was on the single and I come over here to click on the front page, now I can click on it. Okay so it’s just a mechanism for how that works.
So those are the kinds of templates.