{"id":3940,"date":"2026-05-19T12:05:00","date_gmt":"2026-05-19T11:05:00","guid":{"rendered":"https:\/\/www.4uhosting.co.uk\/articles\/knowledgebase\/create-a-child-theme-for-wordpress\/"},"modified":"2026-08-19T14:00:32","modified_gmt":"2026-08-19T13:00:32","slug":"create-a-child-theme-for-wordpress","status":"publish","type":"kb_article","link":"https:\/\/www.4uhosting.co.uk\/articles\/knowledgebase\/create-a-child-theme-for-wordpress\/","title":{"rendered":"Create a Child Theme for WordPress"},"content":{"rendered":"<p>A child theme lets you customise a WordPress theme without editing the parent theme files directly.<\/p>\n<p>This is useful if you need to make code-level changes to a classic WordPress theme. If your site uses a modern block theme, you may be able to make the change from the WordPress Site Editor instead.<\/p>\n<p>You should only create a child theme if you are comfortable editing files and PHP. Take a backup before making changes.<\/p>\n<ol>\n<li>Connect to your hosting account using FTP or cPanel File Manager.<\/li>\n<li>Open the WordPress theme folder:<\/li>\n<\/ol>\n<p><code>\/wp-content\/themes\/<\/code><\/p>\n<ol>\n<li>Create a new folder for the child theme.<\/li>\n<\/ol>\n<p>A common naming style is to use the parent theme folder name followed by <code>-child<\/code>. For example:<\/p>\n<p><code>twentytwentyfive-child<\/code><\/p>\n<ol>\n<li>Inside the new child theme folder, create a file called <code>style.css<\/code>.<\/li>\n<li>Add a theme header to the top of the file.<\/li>\n<\/ol>\n<p>Example:<\/p>\n<pre><code>\/*\nTheme Name: Twenty Twenty-Five Child\nTemplate: twentytwentyfive\nVersion: 1.0.0\n*\/<\/code><\/pre>\n<p>The <code>Template<\/code> value must match the folder name of the parent theme exactly.<\/p>\n<ol>\n<li>Save the <code>style.css<\/code> file.<\/li>\n<li>Create a second file in the child theme folder called <code>functions.php<\/code>.<\/li>\n<li>Add the code needed to load the parent theme stylesheet.<\/li>\n<\/ol>\n<p>Example:<\/p>\n<pre><code>&lt;?php\nadd_action( 'wp_enqueue_scripts', 'child_theme_enqueue_styles' );\n\nfunction child_theme_enqueue_styles() {\n    wp_enqueue_style(\n        'parent-style',\n        get_template_directory_uri() . '\/style.css'\n    );\n}<\/code><\/pre>\n<ol>\n<li>Save the <code>functions.php<\/code> file.<\/li>\n<li>Log in to WordPress.<\/li>\n<li>Go to <strong>Appearance<\/strong> &gt; <strong>Themes<\/strong>.<\/li>\n<li>Activate the child theme.<\/li>\n<\/ol>\n<p>After activating the child theme, check the site carefully. If the design changes unexpectedly, switch back to the parent theme and review the child theme files.<\/p>\n<p>Some parent themes load more than one stylesheet or use their own method for loading styles. In those cases, this basic example may need adjusting by a developer.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A child theme lets you customise a WordPress theme without editing the parent theme files directly. This is useful if you need to make&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"template":"","kb_category":[37],"class_list":["post-3940","kb_article","type-kb_article","status-publish","hentry","kb_category-wordpress"],"_links":{"self":[{"href":"https:\/\/www.4uhosting.co.uk\/articles\/wp-json\/wp\/v2\/kb_article\/3940","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.4uhosting.co.uk\/articles\/wp-json\/wp\/v2\/kb_article"}],"about":[{"href":"https:\/\/www.4uhosting.co.uk\/articles\/wp-json\/wp\/v2\/types\/kb_article"}],"author":[{"embeddable":true,"href":"https:\/\/www.4uhosting.co.uk\/articles\/wp-json\/wp\/v2\/users\/1"}],"version-history":[{"count":1,"href":"https:\/\/www.4uhosting.co.uk\/articles\/wp-json\/wp\/v2\/kb_article\/3940\/revisions"}],"predecessor-version":[{"id":4051,"href":"https:\/\/www.4uhosting.co.uk\/articles\/wp-json\/wp\/v2\/kb_article\/3940\/revisions\/4051"}],"wp:attachment":[{"href":"https:\/\/www.4uhosting.co.uk\/articles\/wp-json\/wp\/v2\/media?parent=3940"}],"wp:term":[{"taxonomy":"kb_category","embeddable":true,"href":"https:\/\/www.4uhosting.co.uk\/articles\/wp-json\/wp\/v2\/kb_category?post=3940"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}