Using code snippets and template customizations in child theme

Every now and then you need to modify plugin or theme’s templates, add some code snippet or change couple things using CSS. Best way to include your changes and make them update proof is to do it via child theme. Child theme is special theme that loads parent theme files from parent theme folder and your customized files from child theme folder like templates and styles.

You need to have base (parent) theme like StoreFront (or Avada, Divi, any WooCommerce compatible theme will do just fine) and then you create new folder wp-content\themes\mycustomtheme\ with its own style.css and functions.php

Here is how to create child theme in 4 easy steps:

Step 1: create child theme folder for example /wp-content/themes/my-first-child-theme

Step 2: in that folder create style.css and functions.php filse, in style.css add code below:

/*
Theme Name: My Sample WordPress Child Theme
Theme URI: https://wpgenie.org
Description: StoreFront theme based child theme
Author: wpgenie
Author URI: https://wpgenie.org
Template: storefront
Version: 1.0
*/

Step 3: go to Appearance -> Themes and activate your newly created child theme.

Step 4: you can now add your modified templates to child theme folder, code snippets to your functions.php and custom CSS to your child theme’s style.css

Once you have customizations in your child theme you can now update plugin or theme without worries that your modifications will be lost during an update (theme or plugin update). ZIP with child theme described in this tutorial can be downloaded here (it will work only if you have installed StoreFront theme).

Detailed tutorial is here How to Create a Child Theme an article by WordPress about child themes.

For example you want to edit Simple Auction template from folder \woocommerce-simple-auctions\templates\single-product\bid.php – copy it to wp-content\themes\yourchildtheme\woocommerce\single-product\bid.php and make changes there. You will need some kind of file manager best is to use FTP client (for example FileZilla or file managed included in your hosting control panel).

Illustration from https://zenwp.co/child-theme/
How child theme templating works from https://zenwp.co/child-theme/

We have extensive archive of code snippets and modified plugin templates on our Pastebin archive.