menu
Ad goes here

Saturday, 11 November 2017

How to Create WordPress Child Theme Step by Step?


Are you directly customizing your WordPress theme? Please stop that, you are not in the right way. If you really care about your customers and security then you must have to upgrade your theme as well as Word Press version in future. Using child theme is the only way to keep all customization even after the version upgrade.

Let’s read how easily you can create WordPress child theme.


Step 01: Create a folder with related name of parent theme inside wp-content/themes/. If the parent theme name is blackberry then you can use 'child-blackberry' so that you easily can identify.



Step 02: Add style.css and functions.php inside the child-blackberry. The style.css must begin with following lines.
/*
 Theme Name:  Black Berry Child
Description:  Black Berry Child Theme developed by 24xhtml.com
 Author:       www.24xhtml.com
 Author URI:   https://www.24xhtml.com
 Template:     blackberry
 Version:      1.0.0
*/

Note: Template field is corresponds to the directory name of parent theme. If you are using any other name of parent or child theme then please change it accordingly.

The functions.php will be started with php start tag (<?php) and close with php closing tag (?>) and between the php tag please add following lines to include style.css.
<?php
add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles' );
function my_theme_enqueue_styles() {
    wp_enqueue_style('parent-style', get_template_directory_uri() . '/style.css' );
}
?>
Step 03: You are almost done with the above two steps and you can activate the theme from admin section (Ex: https://www.24xhtml.com/wp-admin/). Once you access the wp-admin section then you will get left sidebar from there; please click on appearance > themes > find child theme and click on activate button to activate the child theme.

Now start overwriting or add css properties from the child theme’s style.css. If you like to modify header.php, footer.php or any other files then please copy them from parent theme and start your customization inside child theme.

4 comments:

  1. It is a good guide for the creation of WordPress themes. I started my website the same way. Now it has been working for more than two years. In order for me to have more subscribers, I use the plugin https://elfsight.com/youtube-channel-plugin-yottie/, this makes my work more productive, and my site is more popular.

    ReplyDelete
  2. I like the post format as you create user engagement in the complete article. It seems round up of all published posts. Thanks for gauging the informative posts.
    cara menggugurkan kandungan

    ReplyDelete
  3. Thanks for the blog. If you are looking for the creative agency in the web design then, Web Design Ontario is proficient in creating customized website to provide a branded resource for our active customers.

    ReplyDelete
  4. You have shared a nice information about WordPress. It is a very helpful guide for the developers. If you want to know more about website design Manchester NH, Contact us.

    ReplyDelete

Books for you (Crafted with )