Developing WordPress 2020 Child Theme without Plugin

Developing WordPress 2020 Child Theme without plugin within 10 minutes! Yes, it is possible and as a new WordPress user, who is learning theme customization, can easily do it. Although an expert can develop a child theme for less than 5 minutes. However, we are not going to follow as an expert do because I am counting a new WordPress theme customizer as a learner.

So let’s go and start developing wordpress TwentyTwenty child theme:

Friendly advice: Always do the WordPress theme development or customization at a staging or development site or local computer. When you are done or complete with WordPress theme customization, upload the files and folders to a live server or website.

So here, I am assuming you are using staging or development site or local computer for wordpress child theme development for 2020 theme.

Now begins the process for developing wordpress 2020 child theme:

Step 1: Create a new folder insider wp-content > themes folder and name it “wp2020-child” (without quotation mark)

Step 2: Inside wp2020-child folder create 2 files name with style.css and functions.php

Step 3: Open newly created style.css file and add the below codes

/*
Theme name: Child Theme of 2020
Theme URI: https://www.bnwebdesign.com
Author: BN Web Design
Author URI: https://www.bnwebdesign.com
Description: A child theme of WordPress Twenty 20 parent theme.
version: 1.0
Template: twentytwenty
*/

Need to remember: At line number 8 don’t forget to type the folder name properly of main or parent theme. As we are developing wordpress 2020 child theme without plugin, so the template name should be twentytwenty

Step 4: Save the style.css file.

Step 5: Open functions.php file

Step 6: Copy and paste this below codes in functions.php file

<?php 

/*==========================================================
Adding Main or Parent Theme Style.css file in child theme
==========================================================*/

function load_theme_stylesheet(){
    wp_enqueue_style('parent-style', get_template_directory_uri() . '/style.css');
}

add_action('wp_enqueue_scripts', 'load_theme_stylesheet');

?>

What’s happening with the above codes?

We create a function by giving a name load_theme_stylesheet. Then inside this function we enqueue wordpress 2020 parent theme stylesheet. In the end, we call the function with add_action hook.

Step 7: Save it.

That’s it. WordPress 2020 Child theme is ready to use.

Log in and go to Dashboard > Appearance > Themes. The newly developed wp child theme will be there and ready to activate and use.

Leave a Reply

Item added to cart.
0 items - $0.00