Hello, my name is Chrissy and in these lessons, I will show you how to get started with creating a custom WordPress theme for your website. In this lesson, we're going to look at the anatomy of a theme, and specifically we're going to look at what files are required and what files can you have in your WordPress theme. So to do that, we're going to look at the files that are installed on my local WordPress website. So I've got the WordPress website installed on my computer, and right now I'm inside of the WP content folder. You'll see inside of that folder, there is a themes folder, and I've got several theme folders within that. So I've got Chocolate World, Starter Block, Starter Classic, 2021, 2023, and 2022. And you can see behind that, I've got all of those themes installed on my WordPress website. So just putting those files, putting those folders into that themes directory is how the themes get installed. Now there's two types of themes for WordPress. There are classic themes, which is the old way of making themes, and then there are block themes. And most of the themes that you're going to find in the free WordPress theme repository or out there on the premium websites are going to be classic themes. That doesn't mean that you can't use blocks with them, they typically have block support. Some of them don't, but many of them have support for blocks in them, but they're not block themes. So even though they can use blocks, they're not considered block themes. So let's actually take a look at a couple of the themes that I've got installed here. So you can see the files that are required, and then the files that you can have within each of the two different types of themes. Let's start off with a block theme. So we're going to look in Starter Block. That is a very simple block theme. This is all that you need for the files. So these are the only files that are required to create a block theme. You've got style.css, and you've got a templates folder with index.html inside of that. And then you've got the theme.json file. And that's all that you need for your block theme. That's the only files that you absolutely need. So you can see if I was to activate that theme, which is the my first block WordPress theme. I'll just go ahead and activate that. And let's look and see. I think I've got one page in here, I've got a home page. So if I view that, that's what it looks like. Very boring, very simple, very basic. Now if I go back into this directory here, we can see that I've also got a 2023 theme, which was the theme that was previously active. And you can see in that theme, I've got a lot more files. So I do still have the style.css file. And inside of the templates folder, I've got the index.html file. And then I've got the theme.json. But I want to show you that in addition to that, I've got some files such as readme.txt, which is a nice to have file. It's going to be the file that the WordPress theme repository is going to read to get information about things like what version of WordPress is required, what version of PHP is required, what's the license, a description, and all of that information about the theme. It's also going to have a screenshot.png file. And if I go back and look at the WordPress theme, here we go, this is where that screenshot.png file shows up. So notice I didn't have that screenshot.png for my first block WordPress theme, which is the starter block theme. And you can see that there's no image there. So we go back into this folder. You can see that in addition to those in the templates folder, I have additional templates. So I do have the index.html. But I also have 404, archive, blank, blog, alternative, home, page, search, and single. And each of those templates is going to be for a specific type of page within the WordPress website. So now if I go back and I reactivate the 2023 theme, let me reactivate that. And if we look in the editor real quick, I'm going to go into the navigation for this. So you can see all of the templates. And we can see there are the templates for the theme. There's that single. And single is controlled by that single.html file. Let me just kind of put these together. Page is controlled by the page.html file. There's the index. That's the default file that's required. And you can see there's home. That's controlled by home.html. 404 is controlled by 404.html. And then I've got blank, which is controlled by blank.html. There's blog alternative, search, and archive. And you can see that I've got HTML files for each of those. Now, in addition to the templates, I do also have patterns. Those are PHP files. So in order to create patterns, you do need to know PHP. And I've also got a parts folder. And the parts folder is going to include things that belong in the template, such as the header and the footer. So you can see over here, I've got template parts. And I've got header and footer. And in addition to those, I've also got comments and post meta. So these are parts of the other templates that I've got in the templates folder. I also have assets. And inside of that, I've got some fonts. In addition, I've got styles. And these are going to be the color settings that I've got for the themes. Once I activate the theme, I can choose a specific color setting for the theme. Now, in addition to the block themes, we do have classic themes. So let's take a look at a classic theme. And the only files that are required for a classic theme are going to be the index.php file. So instead of index.html, it's going to be index.php, which is going to be a PHP file. It's going to include a bunch of PHP code. And then we also need the style.css file. Those are the only two files that are required. I'm going to go back into my dashboard. And I'm going to activate that theme. I'm going to activate the my first classic WordPress theme. Let me activate that. And we'll take a look at what the website looks like. You can see, again, very boring. This is a starter theme. So it's not going to be very exciting. Now, if you want to see an example of a theme that's got a lot more in it, I'm going to show you this Chocolate World theme. This Chocolate World theme is what's called a starter theme. It's actually the underscores theme, which you can download at underscores.me. And the underscores theme, again, it's called a starter theme. And it's a theme that you can use to learn how to create classic themes in WordPress. And all you need to do is type in the name that you want to use for the theme, and then click on Generate. And that will create a zip file that has all of the files that are necessary for creating that starter theme. And if we take a look at the files that are in there, so we do have the required index.php. And then we've also got the required style.css. But in addition to that, we've also got our templates, which are going to include things like 404. This is analogous to the templates 404.html that we saw in the block theme. And then we've also got archive, which again, analogous to the templates archived.html. We've got comments, which is a template part. And we've got the footer, which is also a template part. So these were in the parts folder in the block theme. So we've got the footer, and then we've also got header. And so that's the header of every page, and then the footer of every page. And we've also got some additional templates like page, search, sidebar is a template part. It's going to be part of other templates, and then single, which is analogous to the single HTML file in the block theme. Now in addition to that, I do have some template parts. And those are going to include content templates that are going to go into some of these other templates, some of these other pages. I do also have the screenshot.png and the readme.txt file, which are very nice to have. You don't need them, but they are nice to have. And again, the screenshot is going to be a screenshot of the home page or the page of the website. Now another thing that I have in here is a functions.php file. This is going to be where I define functions that I'm using within the theme, so it's going to allow me to do things like define capabilities and other load JavaScript, load style sheets, and other things like that. So yeah, as you can see, you can start off with a really, really bare bones website, bare bones template for your theme. So again, you can start off with just those three files that are required for a block theme or the two files that are required for a classic theme, or you can use another theme as a starting point to get started and create your theme from there. Thanks for watching. Stay tuned for the next lesson where we're going to take a look at the style sheets for these themes.