4 Simple Steps to Develop a WordPress Child Theme

Recently, a WordPress Themes Survey has been conducted, and it comes to know that more than 85% of customers are customizing their themes, and only 35% of customers are using a child theme. Because of the less information and understanding about a child theme or difficulty of creating one, very less customers are making use of it.

When it comes to developing a child theme, it enables people to make their desired changes to their website without trying their hands on original theme’s code. Child theme can make it extremely easy for you to update your website without any risk of wiping out changes while you update.

Moreover, this type of theme comes with the functionality of its parent, and the best thing about it is that users can turn off their child theme and fall back on the parent theme any time. If you have decided to develop a WordPress child theme, below mentioned 4 simple steps are completely best that you can follow to customize your wordPress theme with child theme.


First – Get Started

One of the first major things that you need to do is develop a new folder in out themes directory in order to hold the child theme. With the help of cPanel or through FTP, one can easily do it. The themes directory is wp-content/themes.

Make sure to give the name to the folder without any space in the name. Well, it is quite common to use the name of the parent theme folder with “child” added on the end. After it, you have to create a file called style .css and it is the only file required to make a child theme. Ensure that the style sheet must start with below mentioned lines:

1. /*
2. Theme Name: Twenty Thirteen Child
3. Theme URI: http://wordpress.org/themes/twentythirteen
4. Description: Twenty Thirteen Child Theme
5. Author: WPMU
6. Author URI: http://wpmu.com
7. Template: twentythirteen
8. Version: 1.0.0
9. */
10. @import url("../twentythirteen/style.css");
11. /* =Theme customization starts here
12. -------------------------------------------------------------- */

Changing each of the single line is easily possible in order to suit your theme, but make sure to keep Theme Name and Template lines and the @import section. It is one such template that is the folder name of the parent theme.

Now, you can activate your child theme and make sure to login to your WordPress website and go to Appearances > Themes. In the obtainable list of themes, you can find your child theme and click activate. Now, you child theme must be the active theme.


Second – Modify Your Theme’s CSS

Now, your child theme is working like a treat and it can give a look like the parent theme as we have imported its CSS file. If you have decided to change the theme’s CSS, ensure that you add any changes to your website after the original theme’s CSS is loaded. Now, you can say that you wanted to change the text in the theme, so it is pink. You only have to do is add a line to the child themes CSS file:

/*
Theme Name: Twenty Thirteen Child
Theme URI: http://wordpress.org/themes/twentythirteen
Description: Twenty Thirteen Child Theme
Author: WPMU
Author URI: http://wpmu.com
Template: twentythirteen
Version: 1.0.0
*/
@import url("../twentythirteen/style.css");
/* =Theme customization starts here
-------------------------------------------------------------- */

p { color: #FFDFDD;}

By this change to the child theme’s CSS, the original CSS for the patent theme will overwrites. Now, you website looks like this:



Third - Edit the Functions.php File

At the themes main functions, you can find functions.php file that and if you are looking to add custom functions to your theme, you can easily do so by developing a new functions.php file under your child theme folder.

Not like style.css, the functions.php file in a child theme doesn’t supersede its counterpart from the parent. Now, your child theme’s functions.php file will initiate with a php opening tag and end with a php closing tag. However, you are allowed to add your own functions in between.

1. <?php

2. // Stick your php code in here

3. ?>

Fourth – Make sure to edit other themes files

Not like functions.php file, the functions for your theme are other PHP files are not imported automatically. By replacing the file with a copy, it is possible for you to edit other files as well.

Now, the original file of theme is ignored and the new one is used. If you are looking forward to make any changes to 4.0.php file, you need to make a copy of the old field and paste into the child theme. Now, you can make any changes as per your requirement, once the file has been copied.

So, these are the four east steps to develop a WordPress child theme. However, you can also hire a professional WordPress developer for it and get an excellent quality theme development service. You can contact here : info@perceptionsystem.com

2 comments:

Yay! You've decided to leave a comment. That's fantastic! Please keep in mind that comments are moderated and rel="nofollow" is in use. So, please do not use a spammy keyword or a domain as your name, or else it will be deleted.

If you want to link your website with your comment than choose "Comment as: Name/URL" option with respect of above notice.

Let's have a personal and meaningful conversation instead. Thanks for dropping by!

Powered by Blogger.