Contact Us

Address: Ground Floor, Bablu Mension, Karigorpara Road, Amjhupi, Meherpur, 7101
Phone: +8801713902426

    What is WordPress Child Theme and why we should use?

    Those who works with WordPress knows that why child theme is important!
    Today we will try to discuss what is WordPress child theme, why and how to use it.

    What is WordPress child Theme?

    WordPress child theme is a theme where we make changes for our website. When we are using a child theme, we aren’t going to lose our customization when we update our parent theme.

    Why we should use child theme?

    The main theme of WordPress is called parent theme. Suppose Twenty Eighteen. Now if we customize this parent theme, we will lose our customizations if we update the theme. To avoid this problem we will use a child theme. So, child theme is a theme where we will work of HTML, CSS, JS or PHP and can update the parent theme if it gets any update. We will not lose our customization.

    How to use Child Theme?

    There I gave an instruction how to install child theme for your parent theme:
    1. First we need to create a theme folder in wp-themes directory for our child theme. Suppose, our main theme is “twentyeighteen”. Now our child theme name will be “twentyeighteen-child”. That means we just added “-child” to our parent theme name.
    2. You need to have this three file must on your child theme file. Style.css, functions.php, screenshot.png.
    3. In style.css file. You need to put this codes. Here you will change the codes as your themes name and you must use your template name or theme name section.

    /*
     Theme Name:   Twenty Fifteen Child
     Theme URI:    http://example.com/twenty-fifteen-child/
     Description:  Twenty Fifteen Child Theme
     Author:       John Doe
     Author URI:   http://example.com
     Template:     twentyfifteen
     Version:      1.0.0
     License:      GNU General Public License v2 or later
     License URI:  http://www.gnu.org/licenses/gpl-2.0.html
     Tags:         light, dark, two-columns, right-sidebar, responsive-layout, accessibility-ready
     Text Domain:  twenty-fifteen-child
    */
    
    

    4. You need to add this codes on your functions.php file. There is no need to change any code.

    <?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' );
    
    }
    
    

    5. You can use original screenshot.png image from your parent theme. Also if you want you can create a screenshot.png image using adobe Photoshop.

    We have successfully created our child theme. Now go to your WordPress dashboard and activate your child theme from Appearance>Theme option.

    Chat on WhatsApp
    >