If you are looking for how to create a child theme in WordPress then this article is for you.
In this article of 91 TechSquare, We will provide solutions to create a child theme in WordPress. There are many ways to create a child theme in WordPress which are following:
You can choose any name of your directory to create a child theme.
Remember, the file name should be style.css inside your child theme directory as wp-content/themes/your-child-theme-directory/style.css. Then put the below code inside your style.css file.
/* Theme Name: 91 TechSquare Child Theme Theme URI: https://www.91techsquare.com/ Description: A Twenty Thirteen child theme Author: 91TechSquare Author URI: https://www.91techsquare.com Template: twentythirteen Version: 1.0.0 */ @import url("../twentythirteen/style.css");
That’s it. You just need to remember that Template: should be your main theme name and what in line 11 twentythirteen should also be replaced with your main theme directory name.
If you do not want the whole stuff inside style.css, you can also use only the below code.
/* Theme Name: 91 TechSquare Child Theme Template: twentythirteen */ @import url("../twentythirteen/style.css");
Both the code will work with efficiency. Congrats, now you know how to create a child theme in WordPress. You just need to go inside the appearance/theme in the WordPress admin panel. Then activate your child theme.
There is another way to create a child theme in WordPress. Now you need to create two files inside wp-content/themes/your-child-theme-directory. The first one is style.css and another is functions.php
Put the below code inside the style.css file to tell WordPress which template is to be used.
/* Theme Name: 91 TechSquare Child Theme Theme URI: https://www.91techsquare.com/ Description: A Twenty Thirteen child theme Author: 91TechSquare Author URI: https://www.91techsquare.com Template: twentythirteen Version: 1.0.0 */
Or, you can also use the below code in the style.css file
/* Theme Name: 91 TechSquare Child Theme Template: twentythirteen */
Put the below code inside the functions.php file to link enque styles of parent theme to child theme.
<?php add_action( 'wp_enqueue_scripts', 'enqueue_parent_styles' ); function enqueue_parent_styles() { wp_enqueue_style( 'parent-style', get_template_directory_uri().'/style.css' ); } ?>
The child theme is created. You just need to go inside the appearance/theme in the WordPress admin panel. Then activate your child theme.
You can also create a child theme by using the plugin. There are lots of plugins to create a child. Some of the plugins are following as:
Congrats, now you know how to create a child theme. You just need to go inside the appearance/theme in the WordPress admin panel. Then activate your child theme.
Top 5 Android Phones in India Top 5 Android Phones in India for 2024: Unmatched…
https://www.youtube.com/watch?v=QU0Hm7k_hWI Introduction: Previously, in Chapter 2, we discussed html elements and structure. In this chapter,…
https://youtu.be/HihwZMLuXGY Introduction: Welcome back to our HTML course! In the last chapter, we explored the…
Introduction Mastering Laravel Eloquent ORM: Easy Guide for Beginners Laravel, one of the most popular…
https://youtu.be/nPljiJtfBUQ In this chapter We will understand What HTML Is Understanding What HTML Is: Introduction:…
The SOLID principles are a set of guidelines for writing clean and maintainable code that…
This website uses cookies.