We get a lot of enquiries and have to do a lot of integration work on sites where there is a commercial theme installed. Often, our work includes adding template files to the theme, files which would get overridden if the theme gets an update.
In this video I talk about how to use a child theme from the start to make this easier for your future self and for developers working on your site in the future.
AskHighrise Episode 3 - using a child theme with commercial themes.
Morning it’s mark here from Highrise digital and this is a video for question three in our series of videos on AskHighirse where you can ask us anything about the web industry, WordPress, business etc.
So let’s get started with today’s question and that is about parent and child themes particularly involving commercial themes. So we’re not talking about themes that you might build as an agency for someone else we’re talking about commercial themes that you might have purchased or that you might have downloaded from wordpress.org
Let’s just put some context into this so often we get asked a lot to do some integrations with people’s websites particularly around jobs and posting jobs to sites from other sites. We do a lot of work integrating things like Brodbean and LogicMelon and other sources of job postings.
As part of that work we have to add custom post types to their sites and custom taxonomies and that means that we need to add template files to their themes. Those template files are going to be for, like, the post type archive where we’re gonna list out all the jobs or whatever the post type is about and we’re going to add things like taxonomy archives where we can list all the jobs from a specific location or in a specific industry.
What we have to do is put files into their theme, in order to make those work so we can control the display of those pages. Now there’s a problem here so we’re looking at a theme that’s probably been downloaded from either WordPress, or it’s been purchased off something like Theme Forest and that means if I put those files into that theme and then that theme gets an update, maybe it’s a security update or maybe it’s a feature enhancement, as soon as the the client of ours actually presses update then they’re gonna lose all those template files that I’ve put in the theme. This is not good so how do we protect against this?
Well, the answer is that you use WordPress functionality which is called child themes. If you don’t know a child theme is, it is a theme that inherits all of its functionality from a parent, unless you override it in the child theme. So in this instance we’d create a child theme based off of the commercial theme that you’ve bought and you’re wanting to run on your website. We’d then activate that child theme which would inherit all the functionality from the the parent you bought so you wouldn’t lose any functionality.
I can then put my template files in the child theme and any other functions and customizations that I might need for that job and and if you update that commercial or parent theme I’m not going to lose those changes now.
What I see, is a lot of people have built their entire site around this theme they’ve downloaded or this theme they’re using and it has lots of options on it and it has settings for this and that and so on and they’ve set it all up just as they want to. So now the issue with that is if I create a child theme at that point in time you’re gonna lose all those settings. Now some themes have exporters that you can use but they’re not always that great and you don’t keep everything of the functionality.
So on my top tip in this AskHighrise question is that if you’re using a theme that is likely to get updated whether it’s from wordpress.org, whether it’s something you’ve purchased from the theme shop, whether it’s a theme like a Genesis framework, even if you don’t think you need to at this point in time, use a child theme because your developers going to thank you in the future if you’ve already running the child theme now. I come to look at this then it’s gonna be much much easier for me to do the job and it’s gonna cost you less money essentially.
So top tip use a child theme even if you think that you don’t need to use a child theme. If you’re not sure how to use a child theme, then hopefully you’re theme author will tell you. If not there are some actual plugins on wordpress.org there are child theme generators and you can download those literally tick a few options and then it’ll generate you a child theme and then it’s the child theme that you’ll activate not the the one that you’ve downloaded or purchased.
If you like so there you go, top tip, hopefully that will help use a child theme even if you think you don’t need one if you’re using a theme that is likely to get updated, and we’ll see you next time for the next tip.
WordPress website management and owners newsletter
Are you a WordPress website owner? Do you manage a WordPress website? If so why not sign up to our newsletter which provides tips, tricks and insights into running a WordPress website.