Shiba

Adventures in WordPress

  • Home
  • Dog
  • Art
  • Contact
  • WordPress Articles
    • WP Plugins
    • WP Programming
    • WP Admin Panels
    • WP Theme Design
    • WP How-To
    • WP Theme Images
You are here: Home / WordPress Design / Customize Your WordPress Blog with Child Themes

Customize Your WordPress Blog with Child Themes

by ShibaShake Leave a Comment

What are WordPress child themes?

Child themes are a simple way for you to modify WordPress themes, and keep track of all your changes. With child themes you can make all of the same modifications as you would to the parent theme, but you do all of this in a separate child theme area. This allows you to update the parent theme whenever you want and still keep all of the modifications you have made in your child theme area.

There are several different levels of modifications you can make to a child theme. If you are careful with how you make your child theme modifications, you will be able to update the parent theme, and have all your theme modifications automatically transfer to the updated theme with very little effort from you.

Here we discuss how to create child themes. Once you create a child theme, you can easily –

  1. Create child theme static design styles.
  2. Create child theme dynamic design styles.

Create a Child Theme

To create a WordPress child theme all you need to do is create a new directory for your child theme in your blog wp-content/themes directory. Name the directory based on your child theme name, as well as the parent theme name so that you can easily keep track of all your WordPress themes.

For example, one of my blog child themes is called dogs-child-shiba. Dogs is the name of my child theme, child indicates that it is a child theme, and shiba is the name of the parent WordPress theme. This allows me to easily identify all of my child themes, and to quickly see what their parent themes are.

After creating a new child theme directory, create a style.css file within it, and enter the code below into your new style.css file.

/*
Theme Name: dogs-shiba-child
Theme URI: http://www.shibashake.com/wordpress-theme
Description: Child theme for Shiba.
Author: ShibaShake
Author URI: http://www.shibashake.com

Template: shiba
Version: 1.0
Tags: child theme
*/

@import url("../shiba/style.css");

The code above gives you an example child theme definition for the Shiba parent theme. To create your own child theme you want to replace each of the elements with your own child theme information.

Line 2 – Replace with the name of your child theme. (required)

Line 3 – Replace with the name of your blog homepage. (optional)

Line 4 – Replace with a description of your child theme. (optional)

Line 5 – Replace with your name. (optional)

Line 6 – Replace with your website. (optional)

Line 8 – Replace with the directory name of the parent template you are using. (required)

Line 9 – Replace with your child theme version number. You can increase your version number as you make new changes to your child theme.

Line 10 – Tags you want to associated with your child theme. This is important if you want to distribute your child theme for public use. Otherwise, you can use it to help yourself keep track of the features added to your child theme, e.g. widget ready, light, blue.

Line 13 – Includes the parent theme styles into your blog. Replace the parent theme directory name with the parent theme you are using. For example, if you are using the WordPress Classic theme as your parent theme, replace the statement with

@import url("../classic/style.css");

We use the directory name classic here because the WordPress Classic theme is located in the classic directory of your WordPress blog. If you go to Appearance >> Themes in your WordPress blog dashboard, you should be able the see the directory name for all your installed themes.

For example, if you look at the WordPress Classic theme, it should contain the following information –

All of this theme’s files are located in

/themes/classic

This means that the theme directory is called classic. Each theme will have a different theme directory. The WordPress Default theme, for example, is located in the

default

theme directory, and my Shiba WordPress theme is located in the

shiba

theme directory.

Screen-shot of your blog themes and their theme directories.

You’re Done!

And there you have it – your very own child theme. You can apply child themes the same way you apply regular themes on WordPress. Just go to Appearance >> Themes and click on the Activate link right below your child theme.

Once you have a child theme, you can start adding new design styles to your blog or override existing styles that may not suit you. You can also create dynamic styles.

Recent Posts

  • Screenshot of an example article in code view of a modified Gutenberg editor.How to Harness the Power of WordPress Gutenberg Blocks and Combine It with Legacy Free-Form Text
  • Screenshot of the Success, WordPress has been installed page.Migrating Your WordPress Website to Amazon EC2 (AWS)
  • Screenshot of WinSCP for creating a SFTP configuration.How to Set-Up SFTP on Amazon EC2 (AWS)
  • WordPress Gutenberg code view screenshot of this article.How to Prevent Gutenberg Autop from Messing Up Your Code, Shortcodes, and Scripts
  • Screenshot of the Success, WordPress has been installed page.How to Create a WordPress Website on Amazon EC2 (AWS)

Recent Comments

  • Screenshot of the Success, WordPress has been installed page.How to Create a WordPress Website on Amazon EC2 (AWS) (1)
    • Erik
      - Great article. All worked great except for this step:apt install php-mysqlChanging to this fixed it:apt install ...
  • Add Custom Taxonomy Tags to Your WordPress Permalinks (125)
    • Anthony
      - Where does this code go? Like, what exact .php file please?
  • Screenshot of an example article in code view of a modified Gutenberg editor.How to Harness the Power of WordPress Gutenberg Blocks and Combine It with Legacy Free-Form Text (1)
    • tom
      - hi,my experience was like the same, but for me as theme developer the "lazy blocks"(https://wordpress.org/plugins/lazy-blocks/) ...
  • WordPress Custom Taxonomy Input Panels (106)
    • Phil T
      - This is unnecessarily confusing. Why declare a variable with the same name as your taxonomy? Why did you choose a taxonomy ...
  • Create Pop-up Windows in Your WordPress Blog with Thickbox (57)
    • Jim Camomile
      - I have used this tutorial several times and it is one of the few simple and effective ways to add popups with dynamic content, ...

Copyright © 2024 · Genesis Skins by ShibaShake · Terms of Service · Privacy Policy ·