 It's like Buffalo, but cooler. Just kidding. Just kidding. A company called WP Bucks. We are a web maintenance company. This is a topic that is near and dear to my heart, partly because one of the things I am always fixing is when somebody comes to us and says, help, my site is now destroyed because I just updated WordPress or updated my theme. A question I have gotten before is, am I talking about themes for children? That is not the case. A child theme, according to the WordPress Codex, which is a very wordy description, especially if you aren't familiar with child themes. So I like to think of it like if you have a theme of your website because you can change your hat as many times as you want. You can change the color. You can put on Bruins logo instead of a Sabres one because you like to win. I'm just going to make all these changes, but your head is still the same. And so what you're going to see is that that's the same thing with the child theme is, you're changing the child theme and you're making these edits. But it's not actually changing the parent theme because the child theme is just where you make some changes and you're saying, oh, this part's going to look different. But your code base is saying the same because your parent theme is still installed. The important reason to use a child theme is that if you modify a theme directly and then you update that theme, so if you're using Genesis and you've gone into the Genesis theme and you've changed the styles, and then you update Genesis, all of those styles are going to be overwritten because if you're modifying the theme directly, then those files are what gets updated. When an update comes for a theme, it wipes out the entire theme and puts it with brand new files. So by using a child theme, you ensure that your modifications are preserved. A child theme is really simple compared to you. If you've ever looked inside a regular theme that you get like the 2017 theme, for example, there are a lot of files. And so as you are going through there, it may be daunting, but thankfully with a child theme, it can be as simple as you need it to be. The only files that you actually need are a style.css file and a functions.php file. Style.css is where you're going to change all the styles of the theme. So if you want to change the font, if you want to change the background color, you make those changes in the style.css, and if you want to do functionality changes, you'll do those right in the front. I'd write, if you Google child themes, WordPress, you can actually get the example code from, like they put it on there, this exact code is what you need to put in your style.css file. So you don't have to like try and remember it or figure it out, it's literally just you copy and paste. And this is just all like the basic header you need to give your child theme a name because that tells your site what the parent theme is gonna be. So that's how you connect your child theme to your parent theme and say, I'm gonna use everything from this parent theme but make some modifications. Is that PHP file? This again, when you Google child themes to try and remember, this is some stuff that you put in there that just infused styles from the screenshot.png file. That's, you know, when you're looking at your themes and they've got like your list of themes and you've got the pictures in there, that's just you put a screenshot.png file named exactly that and WordPress says, okay, that's the picture to use for the theme. And you put that in the main directory of hill.css and functions.php files. The easiest way, like I said, is to just copy those directly from the WordPress codex. Make sense to you so that you remember. You zip that up and then upload it to the WordPress dashboard just like any other. For example, creating a child theme for the theme which is right now WordPress is default installed. Like you have 2017 on the site but then you install your WordCamp Buffalo theme as a child theme. It's going to check the file. It's gonna look for the parent theme because it sees that you are using a, you have that part that's a template. So that's telling WordPress, okay, this is a child theme. And then it checks to see if the parent theme is already installed. In this case, this is what it would look like if you already had 2017 and you tried to install a child theme, it's gonna, everything is gonna go successful. Now on WordPress.org, then you're gonna get this one it's gonna say this child, or this theme requires a parent theme checking if it's installed. It didn't find it installed so it said preparing to install 2017 because that one is on WordPress.org. So it knew what theme it was looking for. And it does that just because the folder of the parent theme where I put in like 2017 as like just a single word. That told it that that's the one. So if you do one, if you are trying to do like with a parent theme and there's already a folder for it, you wanna make sure that what you've put in there for the template name does match the parent theme that you want, otherwise WordPress could end up installing the parent theme that it thinks you're looking for. So if I had another theme called 2017 that I really wanted to install, WordPress is gonna think that I'm talking about the 2017 theme because as far as they're concerned that's the main, that's a really rare case and doesn't allow multiple things on WordPress.org to have the same folder name. So then say after it's done that, it's gonna say successfully installed the parent theme. So it makes sure that it does that first and then it'll say that it installed your theme successfully. It doesn't do it in the other order because it likes to make sure that it has the parent theme first. In the final case is if the parent theme is missing and can't be found on WordPress.org. So if you had a, I hope that that was the parent theme that one's not on WordPress.org. So it doesn't know where it is. So it's going to give me a warning here that says the parent theme could not be found. So you will need to install the parent theme, Hiroy, before you can use this child theme. It will still install. So this is if the child theme successfully installs because it has a parent theme and that was that screenshot.png, it's not gonna show up in here so you won't see you're gonna tell you that the child theme that's installed but cannot be activated, please install. So WordPress has a lot of checks to make sure that you don't break your site by doing something that you've intentioned in this case would be trying to activate a child theme that has no parent. Any questions about that first part? The setup or install? There are some things that will override and that if you have the style.css, anything you write in there is gonna override any matching styles from the parent theme. Same with templates. So if you put in header.php into that main directory, that's gonna override the header.php from the parent theme. So that way you don't have like conflicting code running. It's just as long as it sees that header.php file in the child theme, it's gonna disregard the one from the parent theme. So it is important to make sure that if you're trying to edit something in the header.php file or any other template files that you copy the entire template over because if you just try and make a change, like if you wanna change one little thing and so you only put that piece of code and then add that header.php file to the child theme, then that means that all the other code that's supposed to be in the header.php will be missing. So you wanna make sure that you copy.php is gonna override any style. It's not gonna override the entire style.css file. The way that WordPress does it is by selector. So if you use the body tag and all you wanna do is just change the main body text, and I'm gonna show you an example of how that works. If you go and you wanna change that, then you just do that selector and you say in your CSS file body, and it's gonna override that body text file, but it won't override anything else about the body text. So it's only going to change whatever style you set. So if you have a size that's already fine and all you wanna do is change the color, then it's only gonna change that color if that's what you put it. Functions.php is a little bit different and that functions just like plugins. Plugins are essentially just separate versions of. That one is unique in the same way that plugins are unique in that they don't override something from the parent theme or from WordPress, they run in addition to. So if you want to add a widget that doesn't currently exist in the theme, if you add it to functions.php, that's going to add a new widget. So you could end up with some conflicting code, that's why it's important to know that is because if you want to override something from the parent theme, like remove it, just adding new code into the child themes functions.php file won't remove that parent theme code. Instead, they'd be running together and if you use like the same function name, you could end up with a little bit of weirdness happening. So you wanna make sure that you remember everything from the parent functions.php will be running. You can turn those off by removing action. If you wanna turn off a bunch of widgets that the parent theme originally had, then you do that by adding some code into functions.php that says remove. This is where they say, it's always said don't do a live demo, which is 100% true, so I made a video backup just in case, but for this case, I am going to take a risk and probably break this site right in front. So I've got here my WordCamp Buffalo theme. This is like the child theme is installed. You've got your standard posts, everything here. It looks just like the 2017 theme because when I go here into the editor, WordPress says stop doing this because it's better to do things by editing through FTP than it is to edit directly in the appearance editor section just because at least if you're using FTP and editing in WebStorm, PHPStorm, or++, something like that, you've got a copy of the file, so if you break it, you can just fix whatever you just broke and re-upload, whereas when you're editing directly through this, it is still, you edit it and it's immediately done on the site. But people commonly do this, which is why I am showing the example theme. So this one is showing, so right now I've got my, I've got 2017 installed, so when I install WordCamp Buffalo, it, again, it saw that 2017 was currently installed, so when I activate, I've now got WordCamp Buffalo here, but the front end of the site looks the same because right now this is what my, so I've got no customization in it whatsoever. Just some examples of how the overriding works. If I wanted to change, for example, this background, so I've got the content and it has, so I've got the page title. That one's got a color set and that's set in the 2017 CSS. If I go back here and I look at, so it's got the colors in the safest way, is I want to target just that section. So in this case, the section that I want to target. I edit that in the child theme, so we've got our changes that we make here. We select a section that we want to update and then when we add it to our child theme, it is going to change the color if your caching is not overriding it. Another thing to keep in mind is if you want to change things that are just for a specific page, you have a couple of options and one that I actually like to use is the additional CSS. So if I'm just changing something on the homepage, you can still make these changes what you add to this database and that's going to change what is done, what shows up, it's going to override what's in your child theme, which is an important thing to know just the hierarchy, which is what the style that's set in your parent theme is going to be overridden by the style that's set in your child theme and the styles that you set in the customizer are going to be overridden by the styles that are set in the line. So it kind of has that hierarchy of the more, it does not. The only way that that changes is when the theme changes. So if you change themes, so like if I, I can actually show you that in a customize, that one's just like a WordPress functionality. Like if I change themes, so I've saved additional CSS, that's gone. The change that I made was in the child theme. So as far as the CSS, like if you do it in the style.css file and then update, that's going to be overridden. If you do it in the customizer, as soon as you activate your child theme, then that's going to be gone because the customizer only reflects what is, only reflects what's in the currently activated theme. That is sometimes the order that it loads in because it's going to load those, the CSS, the additional CSS as it's loading the page. So that can be a bit of a conflict sometimes. The other thing is just anytime you're making those changes and you're storing them in there, it's storing it in the database versus storing it in a file. So if something happens to that, unless you have a database backup, then you've kind of lost your changes versus the changes, like you have the files. So that way, like you can't accidentally make a change to it and then not get back to it because you've got, it's mostly that I've seen where people go and they do some kind of cleanup. I know there are some plugins and I have seen it where it's completely wiped out, additional CSS, and so that I don't know why that happened. I believe it was a bug, but that was one of those ones because it's stored in the database where they lost their changes that way. But the nice thing was you could go back and pull it from, it's just that you can then use it on multiple sites because I can make my changes to the style.css file and all those changes are immediately in my file. So if I want to then copy that into a different website, I've immediately got all my changes versus if you do it in the customizer, additional CSS, you'd have to copy all that CSS out and either put it in the style.css file or copy it over into the other one. So it's just a little less portable and especially helpful if you're using like a staging site, like a development, test it on one is you can just copy the theme files, copy the theme over, make your changes, test it out and then copy it back. The other things to keep in mind with sections, so if you wanted to add a new menu, you wanna make sure that you put it in, as we were talking about before, is any one of these when you go, can also be copied over and edited and you're gonna place those in the exact same place. So if it's in the main directory and it's called page.php, you're gonna wanna put that in your child theme and then make customizations to it that way to keep in mind is making sure that that any files you wanna change you put over into the child theme. I have seen it where sometimes people edit the CSS in the child theme, but they edit templates in the parent theme and then they lose some of their changes which makes it a little bit harder to figure out too because when you go to a site afterward and it's got a child theme, but you can't figure out why some of those themes, why some of those changes were overwritten on the templates and so there's also plugins when it becomes really helpful is when you have like a plugin such as the events calendar which allows you to do custom templating or the give plugin you can then add here. So if you wanted to change like the donation page rather than having to go in and edit the files of the plugin because it works the same way. If you edit a plugin's files and then you update that plugin, your customizations are gone. Just not good in that if you're here for Adam's talk, one of the things he was talking about in the last one was security. You never want to make changes to a theme or a plugin and then not update it because you've made changes and that would override it because that leads to a whole bunch of security issues and so it's nice to be able to change these plugins so you can change what your donation form looks like. You can change functionality of these plugins by using a child theme and then just putting those extra templates here and they go right in the directory. That's something that you need to do through like FTP. You can't, lots of plugins that have the ability for you to edit them right there. Same with WooCommerce. You can pretty much override anything in WooCommerce. Just don't do it in the WooCommerce plugin. Make sure you do that file structure any template you want and then anytime you update WooCommerce, your changes stay the same. Like they don't get overwritten. Anytime you update your theme, everything stays the same because the only thing in here, the reason you don't need to ever update your child theme except if there's like advanced code you've put in there that has to be updated to work with something but you don't have to worry really about security when you've got these child themes and you don't update them because you should only be putting your changes in there. The checkout page on WooCommerce and you put that in your child theme, you just wanna have that checkout PHP template. You don't wanna put all of the WooCommerce templates in here so you can change one because then you've got super outdated WooCommerce. I want to just cover that there are themes in the repository and so just one thing to be aware of is that there are actually child themes in the WordPress.org repository. A very common one is you've got the storefront theme but then there are a whole bunch of that are for storefront that are in the WordPress.org repository so one thing to keep in mind is that you can't have a child of a child. It's been talked about whether you should whether they should allow grandchild themes because of the fact that people are using paid themes that are child themes, parent themes. So like Genesis, for example, they sell the Genesis framework and then they sell child themes and so you've got a parent theme and a child theme built right in. So that's just one of those things you have to watch out for. In that case, Genesis doesn't release updates for that. However, with some of the storefront ones, the storefront is the parent theme, that one's by WooCommerce and then you've got these child themes and they will actually release updates for them. So there is a bit of a warning with that which is just to remember that if you're using a child theme that receives updates that it will still be overwritten, update a theme file or a theme folder, I mean, in WordPress it's gonna overwrite. So they should have it in the description. Looking to see. I know that there are a bunch in here. Trying to remember which one. So they've got these ones that are child themes. So it is a bit tricky because you have to have storefront installed for this one to work. So you've already got your parent theme and child theme in there. So you won't be able to make a shopaholic child theme. There have been some that have written some code to get around that. I have seen ones where they have a framework child theme and or a framework theme and then child theme is what they call it. They tend to have some issues. This is not one of those that does that. So in that case, you've just got your parent theme and child does its own customization of the parent theme child theme. And that's one of those ones where people get confused because they make all their changes in a child theme and then those changes disappear. So that's just, there are always those exceptions. And in those cases, it means that somebody kind of went away from the WordPress way of doing things. And so those are definitely the exception and not the rule. In this case, if you install one that's got a, or that is a child theme, it's gonna automatically in that same way. So I didn't have storefront installed before, but just by installing, the one would be the child theme that required the parent. And so it gives that dialogue. And so like when you're installing from like the customizer, it's just, it installs and says it's installed. It doesn't give you the, if I didn't have storefront already installed and we'd gone into the themes and done it through the regular theme installer, you would have seen that same dialogue. It would have, it would have first started to install the shopaholic, gotten to the point in the shopaholic. This one has a template that it's using. It's using storefront. So it's gonna go look for that storefront parent. Blah, blah, blah, blah. WordPress.org won't allow that to happen on the repository. As far as I know, they are only allowing child themes. Yeah, that's pretty much, that's really your only option for ones like this. You can make changes here in this file. How it's gonna be updated. I mean, they're on version 2.0.1, which means that there were versions before that. And so anytime, like if this updates to 2.0.2 and you install that child theme update, it is going to all, they probably will release a 2.0. It's a bit of, these are like the outliers. It's mostly with storefront because that one's becoming like the go to store theme where we're starting to see it more and more where partly for this issue because of the fact stuck with a child theme that also will receive updates. If you're really not customizing anything about the look and you're using the theme as is, you don't need a child theme in those cases. It's not that often that I see that somebody hasn't tried to customize something. So as soon as you wanna make those style changes, you'll definitely wanna child theme. But it's not necessary if you're gonna use a theme exactly as it is and only make changes in the customizer. If you set it up as within the page itself, then all that is gonna be contained within the page. If you made any changes in like that case. I was talking about content. Yup, yeah. Okay, since it's, since you're talking content, in that case, if there's a change that you wanna make to all of them, you'd wanna do that with a child theme. If it's just within the content, your best bet is just to copy those pages. There's a plugin that can do that. There are, yeah. So there's, there are some, part of it is just that they add a lot of, like a full interface which is nice to have. Like if copying that code over and editing directly in there isn't really what you're interested in doing, then this one does work. It kinda, it adds a lot of options, but it can come in handy because it's got, you know, it's got like create a new child theme, configure an existing child theme, duplicate. I've just found that that is a little bit clunky and so that it could be managed, right? So that is all the time that I have. I will be around all day and at the happiness bar, I'm sure, plenty of times, so if you have any more questions, I'm happy to answer them or help you if you've got like a child theme question or anything like that, so thank you very much.