{"id":53,"date":"2025-08-25T18:10:23","date_gmt":"2025-08-25T18:10:23","guid":{"rendered":"http:\/\/atiksnote.test\/?p=53"},"modified":"2025-08-25T18:10:23","modified_gmt":"2025-08-25T18:10:23","slug":"how-to-create-a-wordpress-child-theme-step-by-step-guide-for-beginners","status":"publish","type":"post","link":"https:\/\/atiksnote.urnoit.com\/index.php\/2025\/08\/25\/how-to-create-a-wordpress-child-theme-step-by-step-guide-for-beginners\/","title":{"rendered":"How to Create a WordPress Child Theme"},"content":{"rendered":"\n<h4 class=\"wp-block-heading\">1) Create the child theme folder<\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Go to <code>\/wp-content\/themes\/<\/code><\/li>\n\n\n\n<li>Create a new folder named <code>&lt;parent-slug>-child<\/code><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Example: if the parent theme folder is <code>astra<\/code>, make <code>astra-child<\/code>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The <strong>parent slug must match the parent theme\u2019s folder name<\/strong>, not its display name.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h4 class=\"wp-block-heading\">2) Add <code>style.css<\/code> (required)<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Create <code>\/wp-content\/themes\/&lt;parent-slug>-child\/style.css<\/code> with this header (edit values):<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/*\n Theme Name: Astra Child\n Template: astra\n Text Domain: astra-child\n Description: Child theme for Astra\n Author: Your Name\/Company\n Version: 1.0.0\n*\/\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The <code>Template:<\/code> value <strong>must<\/strong> equal the parent theme\u2019s folder (e.g., <code>astra<\/code>, <code>hello-elementor<\/code>, <code>twentytwentyfive<\/code>).<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h4 class=\"wp-block-heading\">3) (Classic themes) Enqueue styles in <code>functions.php<\/code><\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">If your parent is a <strong>classic<\/strong> theme (most non-FSE themes), create <code>\/wp-content\/themes\/&lt;parent-slug>-child\/functions.php<\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;?php\nadd_action( 'wp_enqueue_scripts', function () {\n    \/\/ Load parent style first.\n    wp_enqueue_style(\n        'parent-style',\n        get_template_directory_uri() . '\/style.css',\n        &#91;],\n        wp_get_theme( get_template() )->get( 'Version' )\n    );\n\n    \/\/ Then child style.\n    wp_enqueue_style(\n        'child-style',\n        get_stylesheet_uri(),\n        &#91; 'parent-style' ],\n        wp_get_theme()->get( 'Version' )\n    );\n} );\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Don\u2019t use <code>@import<\/code> in CSS. Always enqueue.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h4 class=\"wp-block-heading\">4) Activate the child theme<\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li>In wp-admin \u2192 <strong>Appearance \u2192 Themes<\/strong><\/li>\n\n\n\n<li>You should see \u201cYourTheme Child\u201d with your screenshot (optional). Activate it.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Optional: Add <code>\/screenshot.png<\/code> (1200\u00d7900 px recommended) so it looks nice in the admin.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h4 class=\"wp-block-heading\">5) Customize safely<\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Classic themes:<\/strong> Copy only the template file you need from the parent into the child (keep the same relative path), then edit. Example: copy <code>header.php<\/code> \u2192 child theme <code>header.php<\/code>.<\/li>\n\n\n\n<li>Put custom PHP (hooks\/filters) in the child\u2019s <code>functions.php<\/code>. <strong>Do not<\/strong> duplicate parent function names\u2014use actions\/filters instead.<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>1) Create the child theme folder Example: if the parent theme folder is astra, make astra-child. The parent slug must match the parent theme\u2019s folder name, not its display name. 2) Add style.css (required) Create \/wp-content\/themes\/&lt;parent-slug>-child\/style.css with this header (edit values): The Template: value must equal the parent theme\u2019s folder (e.g., astra, hello-elementor, twentytwentyfive). 3) [&hellip;]<\/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-53","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/atiksnote.urnoit.com\/index.php\/wp-json\/wp\/v2\/posts\/53","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/atiksnote.urnoit.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/atiksnote.urnoit.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/atiksnote.urnoit.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/atiksnote.urnoit.com\/index.php\/wp-json\/wp\/v2\/comments?post=53"}],"version-history":[{"count":0,"href":"https:\/\/atiksnote.urnoit.com\/index.php\/wp-json\/wp\/v2\/posts\/53\/revisions"}],"wp:attachment":[{"href":"https:\/\/atiksnote.urnoit.com\/index.php\/wp-json\/wp\/v2\/media?parent=53"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/atiksnote.urnoit.com\/index.php\/wp-json\/wp\/v2\/categories?post=53"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/atiksnote.urnoit.com\/index.php\/wp-json\/wp\/v2\/tags?post=53"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}