{"id":607,"date":"2019-02-18T14:31:32","date_gmt":"2019-02-18T06:31:32","guid":{"rendered":"https:\/\/www.intelliwolf.com\/?p=607"},"modified":"2020-04-15T17:23:23","modified_gmt":"2020-04-15T09:23:23","slug":"create-wordpress-child-theme","status":"publish","type":"post","link":"https:\/\/wordpress-757293-2559390.cloudwaysapps.com\/create-wordpress-child-theme\/","title":{"rendered":"How To Create A Child Theme For Any WordPress Theme"},"content":{"rendered":"\n

Child themes are a staple of every WordPress developer.<\/p>\n\n\n\n

There are times when the functionality provided by the theme developer doesn't meet your needs and you want to add something else.<\/p>\n\n\n\n

I'll often say in my tutorials to \"edit the functions.php<\/em> file\". Whenever I say that, I'm assuming you're editing a child theme.<\/p>\n\n\n\n

You should never<\/strong> edit the theme files. When you update a theme to a new version, all your added code will be deleted.<\/p>\n\n\n\n

To add custom programming to your theme, always<\/strong> use a child theme.<\/p>\n\n\n\n

What is a WordPress child theme?<\/h2>\n\n\n\n

A WordPress child theme builds upon or overwrites the functionality of the parent theme.<\/p>\n\n\n\n

It brings in everything from the parent theme, other than any changes you made to the Customizer.<\/p>\n\n\n\n

At its most simple, it's just a stylesheet and a few lines of code in a PHP file.<\/p>\n\n\n\n

You need to have the parent theme installed, but only the child theme will be active.<\/p>\n\n\n\n

Any subsequent updates to the parent theme will apply to the child theme, unless you've already overwritten them.<\/p>\n\n\n\n

On the front end, the parent theme CSS is loaded first, followed by the child theme CSS. That way you can overwrite styles without usually needing to add !important<\/em>.<\/p>\n\n\n\n

How to create a child theme for any WordPress theme<\/strong>:<\/p>\n\n\n\n

  1. Create a folder for your child theme<\/li>
  2. Create a style.css<\/em> file referencing the parent theme<\/li>
  3. Create a functions.php<\/em> file that brings in the parent and child stylesheets<\/li>
  4. Zip the folder<\/li>
  5. Install the zipped file as a new theme<\/li>
  6. Activate your new child theme<\/li><\/ol>\n\n\n\n

    Let's build a bare bones child theme for GeneratePress, because it's awesome, I use it all the time and there's a free version available here<\/a>.<\/p>\n\n\n\n

    Download Child Themes<\/h2>\n\n\n\n

    If you'd like to download the bare bones child themes I use, please right-click any of the links below and save them to your computer. They're around 20kb each.<\/p>\n\n\n\n