Web Development

Create Child Theme of Any WordPress Theme to do Experiments

Child themes are clone of your original wordpress themes which lets you to modify theme in your own way without facing error or conflicting the actual theme. If you wants to tweak a theme in your own way then you should use it's child theme version. Learn to create child theme here.

Child Themes are the clone copy of your original WordPress theme which lets you modify the theme in your own way without conflicting the original theme.

If you want to do a code tweak, design tweak or any serious coding in your WordPress theme then it is highly recommended that you first make the child theme version of that theme then do further editings.

Creating Child Theme is not much tedious task but doing experiments with your WordPress theme without making Child Theme can create problem for you.

WordPress Child Theme Support

How Child Theme Works ?

When you create child theme and activate it, the WordPress first looks at the files at you child theme folder. If it found the required file there, it will run it but iWordPressss finds any file missing or having error in Child theme folder then it will move to the parent theme for that file.

In this way, you can easily tweak your WordPress theme without concerning about data loss, theme broken or else theme.

FEATURED : 200+ WordPress Working Ping List

Create Your Own Child Theme

Creating child version of any of your WordPress theme is just a piece of cake. For creating child theme, you need to have access of your FTP Server and WordPress Admin Panel.

Steps to Create Child Version of WordPress Theme

Step 1 : Create Your Child Theme Folder

You first need to log-in your file manager where all your website’s file are available. This you can do either from cPanel, WHM or from FTP Clients like the most popular FileZilla Software.

FileZilla browsing of your Website’s Root Folder
  • After logging-in to your FTP account, from document root (public_html) navigate to wp-content >>themes.
  • This is the location where you have to create your child theme folder. Create a folder and name it parenttheme-child, where parenttheme is your original theme’s name.

However, you can use any name for your child theme folder but I recommend you to use parenttheme-child so that you child theme can easily be identified.

Step 2 : Create Stylesheet file of your Child Theme

Stylesheet file (style.css) is a very common and most important file of your WordPress theme. It handles for style, structure of you theme. Style.CSS also handles your themes’ class, hooks, etc which are very important.

Seems difficult ? It’s not so. 😉

MUST READ : 8 Powerful Tips To Secure Your WordPress Website

  • Inside the child theme’s folder which you made in Step 1, create a new file and name it, style.css.
  • Now, open your favorite code or text editor and put this few line of code to into your blank style.css file :

Here I am taking example of default twentyeleven theme.

Now, let me explain every line of this small code.

  • Theme Name : (required) use your parenttheme-child name for e.g., twentyeleven-child.
  • Theme URI : (optional) URL of the theme creator.
  • Description : (optional) If you want to add some information about the theme.
  • Author : (optional) Put Your Name Here.
  • Author URI : (optonal) Author’s URL
  • Template : (required) name of your parenttheme folder e.g., twentyeleven.
  • Version : (optional) Indicates your theme’s version
  • @import : (required) This will import the style.css from twentyeleven. You have to put full URL location of your original theme’s style.css file.
Activating Twenty Eleven Child Theme from WordPress Admin Panel

 

Step 3 : Activating Your Child Theme

Now, just log-in to your dashboard, navigate to Appearance>>Theme. Here you will find your “just created” child theme. Activate it and it’s over. 😀

Overriding The Parent Theme’s File

Now, here in your child theme, you can put any edited version of your original theme’s file. But you have to maintain the file structure.

For e.g., To edit loop.php file available at “includes” folder of twentyeleven, you have to first make includes folder inside your child theme then put edited loop.php file here.

READ ALSO : 5 Must Have WordPress Plugins for WordPress Theme Developers

Hope, this article will be helpful. If you have any problem then let me know by commenting below. 🙂

About the author

Saurabh Saha

Saurabh Saha is techno geek and the owner of Pharmaceutical-grade-fish-oil.biz. He loves to learn new tricks and share them with his readers. Saurabh is currently pursuing MCA from University of Delhi.

Add Comment

Click here to post a comment