{"id":110,"date":"2022-12-30T14:38:30","date_gmt":"2022-12-30T14:38:30","guid":{"rendered":"https:\/\/www.gplbot.com\/blog\/?p=110"},"modified":"2022-12-30T14:38:31","modified_gmt":"2022-12-30T14:38:31","slug":"how-to-create-child-theme-for-any-theme","status":"publish","type":"post","link":"https:\/\/www.gplbot.com\/blog\/how-to-create-child-theme-for-any-theme\/","title":{"rendered":"How to create child theme for any theme?"},"content":{"rendered":"\n<p>To create a child theme for any theme, you will need to follow these steps:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Create a new folder in your WordPress installation&#8217;s <code><strong>wp-content\/themes<\/strong><\/code> directory. This folder will contain your child theme files.<\/li>\n\n\n\n<li>Create a <code><strong>style.css<\/strong><\/code> file in the new folder. This file will contain the styles for your child theme.<\/li>\n\n\n\n<li>In the <code><strong>style.css<\/strong><\/code> file, add the following lines at the top:<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>\/*\r\n Theme Name: My Child Theme\r\n Theme URI: \r\n Description: My child theme\r\n Author: Your Name\r\n Author URI: \r\n Template: parent-theme-folder-name\r\n Version: 1.0.0\r\n*\/\n\r<\/code><\/pre>\n\n\n\n<ol class=\"wp-block-list\" start=\"4\">\n<li>Replace <code>My Child Theme<\/code> with the name of your child theme, and <strong><code>parent-theme-folder-name<\/code> <\/strong>with the folder name of the parent theme.<\/li>\n\n\n\n<li>Add any custom styles for your child theme in the <code><strong>style.css<\/strong><\/code> file below the comments.<\/li>\n\n\n\n<li>Create a <code><strong>functions.php<\/strong><\/code> file in the new folder. This file will contain the functions for your child theme.<\/li>\n\n\n\n<li>In the <code><strong>functions.php<\/strong><\/code> file, add the following lines:<\/li>\n\n\n\n<li><\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;?php\r\nadd_action( 'wp_enqueue_scripts', 'enqueue_parent_styles' );\r\n\r\nfunction enqueue_parent_styles() {\r\n   wp_enqueue_style( 'parent-style', get_template_directory_uri().'\/style.css' );\r\n}\r\n<\/code><\/pre>\n\n\n\n<ol class=\"wp-block-list\" start=\"8\">\n<li>Activate the child theme through the WordPress admin dashboard by going to Appearance &gt; Themes.<\/li>\n<\/ol>\n\n\n\n<p>That&#8217;s it! Your child theme should now be active and you can start customizing the appearance of your site by modifying the styles in the <code><strong>style.css<\/strong><\/code> file and adding custom functions in the <code><strong>functions.php<\/strong><\/code> file.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>To create a child theme for any theme, you will need to follow these steps: That&#8217;s it! Your child theme<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-110","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/www.gplbot.com\/blog\/wp-json\/wp\/v2\/posts\/110","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.gplbot.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.gplbot.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.gplbot.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.gplbot.com\/blog\/wp-json\/wp\/v2\/comments?post=110"}],"version-history":[{"count":1,"href":"https:\/\/www.gplbot.com\/blog\/wp-json\/wp\/v2\/posts\/110\/revisions"}],"predecessor-version":[{"id":111,"href":"https:\/\/www.gplbot.com\/blog\/wp-json\/wp\/v2\/posts\/110\/revisions\/111"}],"wp:attachment":[{"href":"https:\/\/www.gplbot.com\/blog\/wp-json\/wp\/v2\/media?parent=110"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gplbot.com\/blog\/wp-json\/wp\/v2\/categories?post=110"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gplbot.com\/blog\/wp-json\/wp\/v2\/tags?post=110"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}