How to Customize a WordPress theme
Here we will know, how to create a child theme for WordPress theme customization. Most of the time we purchase a premium theme for creating our website with WordPress. Sometimes we may need to get some design changes and add or remove some functionalities.
Today we will create a child theme step to step for “twentytwentyone” of the default WordPress theme for learning WordPress theme customization.
Step-1: Create a new folder and named it “twentytwentyone-child” at the theme folder root directory.
Step-2: Now we create a style.css file inside the “twentytwentyone-child” folder. and open it with a text editor like Notepad++, VS Code studio, Dreamweaver, or any others.
Step-3: Now write the following code below at the style.css file…
/*
Theme Name: Child Of Twentytwentyone
Theme URL: https://shanto.net
Theme Description: This is my first child theme
Author: Riadujjaman Shanto
Author mail: contact@shanto.net
Template: twentytwentyone
*/
Create a functions.php file in child theme folder
Step-4: Create a functions.php file inside the “twentytwentyone-child” folder. And open it with the editor. then enqueue style.css file by written code below and save it.
<?php
function child_styesheet_enqueue(){
wp_enqueue_style('child_style', get_stylesheet_uri());
}
add_action('wp_enqueue_scripts', 'child_styesheet_enqueue', PHP_INT_MAX);
Now our child theme is completely ready for work at the main theme.
Step-5: Now we have to log in to our WordPress dashboard/backend. Click on Appearance and then click on Themes. Here we should see our child theme if we have done all steps Exactly.
We have to activate our child theme now from WordPress Dashboard.
Now we can write any CSS at child theme style.css file which we want to change our site. And reload at the front end to see changes.
Also, we can add new functionality to the functions.php file of the child theme. And it will apply to our main theme.
If you complete every step and do not see your changes at the front end of the site. please clear the browser cache and reload your site again.
If you are don’t know to write code but want to get some change on your site. please contact me. Also, I’m providing every type of WordPress service.
This content was helpful. Thanks.
I was search this topic many time. Thanks.
Stay connected with Shanto.Net. We will publish more content about WordPress.