{"id":25,"date":"2024-02-27T21:08:59","date_gmt":"2024-02-27T21:08:59","guid":{"rendered":"https:\/\/kwwd.co.uk\/blog\/?p=25"},"modified":"2024-04-04T02:29:57","modified_gmt":"2024-04-04T02:29:57","slug":"create-a-wordpress-child-theme","status":"publish","type":"post","link":"https:\/\/www.kwwd.co.uk\/blog\/create-a-wordpress-child-theme\/","title":{"rendered":"Create A WordPress Child Theme"},"content":{"rendered":"<p>In order to create a Child theme we need to add a minimum of two files<\/p>\n<p>Create a new folder which will hold your child theme files and create a file called style.css which contains the following code:<\/p>\n<pre><code class=\"language-css line-numbers\">\/*\r\nTheme Name: Your Child Theme Name\r\nTheme URI: https:\/\/yourwebsite.com\/\r\nAuthor: Your Name\r\nAuthor URI: https:\/\/yourwebsite.com\/\r\nDescription: A child theme of [Parent Theme Name]\r\nTemplate: [Parent Theme Name] \/\/ Replace with the actual parent theme name\r\nVersion: 1.0.0\r\nLicense: GNU General Public License v2 or later\r\nLicense URI: https:\/\/www.gnu.org\/licenses\/gpl-2.0.html\r\nText Domain: [Your Child Theme Text Domain] \/\/ Optional, for translations Use the same in your functions\r\n*\/<\/code><\/pre>\n<p>Note: Remove the the sections that include &#8220;\/\/&#8221; and following text.<\/p>\n<p>You will then need to create a file named &#8220;functions.php&#8221; and include the following code:<\/p>\n<pre><code class=\"language-php line-numbers\">&lt;?php\r\n\r\n\/\/ Load Parent Styles from the main theme into the child theme\r\nfunction my_theme_enqueue_styles() {\r\n    wp_enqueue_style( 'parent_theme_style', get_template_directory_uri() . '\/style.css' );\r\n    wp_enqueue_style( 'child_theme_style', get_stylesheet_uri() );\r\n}\r\nadd_action(\"wp_enqueue_scripts\", \"my_theme_enqueue_styles\");\r\n\r\n\r\n?&gt;<\/code><\/pre>\n<p>After that your Child Theme will be accessible in the Appearance &gt; Themes Page<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In order to create a Child theme we need to add a minimum of two files Create a new folder which will hold your child [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[11,10,9,13,12],"class_list":["post-25","post","type-post","status-publish","format-standard","hentry","category-wordpress","tag-child-theme","tag-css","tag-php","tag-themes","tag-wordpress"],"_links":{"self":[{"href":"https:\/\/www.kwwd.co.uk\/blog\/wp-json\/wp\/v2\/posts\/25","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.kwwd.co.uk\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.kwwd.co.uk\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.kwwd.co.uk\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.kwwd.co.uk\/blog\/wp-json\/wp\/v2\/comments?post=25"}],"version-history":[{"count":0,"href":"https:\/\/www.kwwd.co.uk\/blog\/wp-json\/wp\/v2\/posts\/25\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.kwwd.co.uk\/blog\/wp-json\/wp\/v2\/media?parent=25"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.kwwd.co.uk\/blog\/wp-json\/wp\/v2\/categories?post=25"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.kwwd.co.uk\/blog\/wp-json\/wp\/v2\/tags?post=25"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}