{"id":8182,"date":"2026-05-10T17:58:57","date_gmt":"2026-05-10T15:58:57","guid":{"rendered":"https:\/\/mybox.com\/help\/?post_type=manual_kb&#038;p=8182"},"modified":"2026-06-15T01:59:24","modified_gmt":"2026-06-14T23:59:24","slug":"cum-sa-creati-o-tema-copil-wordpress-utilizand-wp-cli","status":"publish","type":"manual_kb","link":"https:\/\/mybox.com\/help\/ro\/knowledgebase\/how-to-create-a-wordpress-child-theme-using-wp-cli\/","title":{"rendered":"Cum s\u0103 crea\u021bi o tem\u0103 copil WordPress utiliz\u00e2nd WP-CLI"},"content":{"rendered":"<div class=\"translation-block translation-block-merged\">\n<p class=\"wp-block-paragraph\">A WordPress child theme allows you to customize an existing theme without modifying the original theme files. This is important because changes made directly in the parent theme may be lost during theme updates.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">WP-CLI makes it possible to create a child theme quickly from the command line.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_86 ez-toc-wrap-left counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/mybox.com\/help\/ro\/knowledgebase\/how-to-create-a-wordpress-child-theme-using-wp-cli\/#What_Is_a_Child_Theme\" >What Is a Child Theme?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/mybox.com\/help\/ro\/knowledgebase\/how-to-create-a-wordpress-child-theme-using-wp-cli\/#Before_You_Begin\" >Before You Begin<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/mybox.com\/help\/ro\/knowledgebase\/how-to-create-a-wordpress-child-theme-using-wp-cli\/#Check_the_Parent_Theme_Name\" >Check the Parent Theme Name<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/mybox.com\/help\/ro\/knowledgebase\/how-to-create-a-wordpress-child-theme-using-wp-cli\/#Create_the_Child_Theme\" >Create the Child Theme<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/mybox.com\/help\/ro\/knowledgebase\/how-to-create-a-wordpress-child-theme-using-wp-cli\/#Activate_the_Child_Theme\" >Activate the Child Theme<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/mybox.com\/help\/ro\/knowledgebase\/how-to-create-a-wordpress-child-theme-using-wp-cli\/#Edit_the_Child_Theme_Files\" >Edit the Child Theme Files<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/mybox.com\/help\/ro\/knowledgebase\/how-to-create-a-wordpress-child-theme-using-wp-cli\/#Test_the_Website\" >Test the Website<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/mybox.com\/help\/ro\/knowledgebase\/how-to-create-a-wordpress-child-theme-using-wp-cli\/#Summary\" >Summary<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"What_Is_a_Child_Theme\"><\/span>What Is a Child Theme?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<\/div>\n\n<div id=\"mybox-2484810772\" class=\"mybox-content mybox-entity-placement\"><div class=\"early-access-banner-inpost\">\r\n  <div class=\"banner-left-inpost\">\r\n    <div class=\"icon-box-inpost\">\r\n      <img decoding=\"async\" src=\"https:\/\/mybox.com\/help\/wp-content\/uploads\/2026\/02\/square-info-icon.svg\" alt=\"Info\">\r\n    <\/div>\r\n    <div class=\"text-box-inpost\">\r\n      <span class=\"label-inpost\"><span class=\"translation-block translation-block-banner-text\">Acces timpuriu<\/span><\/span>\r\n      <h4><span class=\"translation-block translation-block-banner-text\">Mai ave\u021bi nevoie de ajutor?<\/span><\/h4>\r\n      <p><span class=\"translation-block translation-block-banner-text\">Contacta\u021bi echipa noastr\u0103 de servicii pentru clien\u021bi.<\/span><\/p>\r\n    <\/div>\r\n  <\/div>\r\n\r\n  <div class=\"banner-right-inpost\">\r\n    <a href=\"https:\/\/panel.mybox.com\/helpdesk2\/v\/list\/\" class=\"banner-button-inpost\"><span class=\"translation-block translation-block-banner-text\">Trimite mesaj<\/span><\/a>\r\n  <\/div>\r\n<\/div><\/div>\n\n<div class=\"translation-block translation-block-merged\"><p class=\"wp-block-paragraph\">A child theme is a theme that inherits the design and functionality of another theme, called the parent theme.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You can use a child theme to safely modify:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>CSS styles<\/li>\n\n\n\n<li>Template files<\/li>\n\n\n\n<li>Theme functions<\/li>\n\n\n\n<li>Layout elements<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">The parent theme can still be updated without overwriting your custom changes.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Before_You_Begin\"><\/span>Before You Begin<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">You need:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>SSH access to the server<\/li>\n\n\n\n<li>WP-CLI installed<\/li>\n\n\n\n<li>WordPress already installed<\/li>\n\n\n\n<li>The parent theme already installed<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Connect to your server via SSH and go to your WordPress installation directory:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cd public_html\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The exact directory may differ depending on where WordPress is installed.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Check_the_Parent_Theme_Name\"><\/span>Check the Parent Theme Name<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Before creating the child theme, check the installed themes:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>wp theme list\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Find the parent theme slug in the <code>name<\/code> column.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>twentytwentyfour\nastra\ngeneratepress\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">You will need this slug in the next step.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Create_the_Child_Theme\"><\/span>Create the Child Theme<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Use the following command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>wp scaffold child-theme my-child-theme --parent_theme=parent-theme-slug\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Replace:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>my-child-theme<\/code> with the name of your child theme folder<\/li>\n\n\n\n<li><code>parent-theme-slug<\/code> with the actual parent theme slug<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>wp scaffold child-theme astra-child --parent_theme=astra\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">WP-CLI will create the child theme directory and the required files automatically.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Activate_the_Child_Theme\"><\/span>Activate the Child Theme<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">After creating the child theme, activate it with:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>wp theme activate astra-child\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">You can confirm that it is active by running:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>wp theme list\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Edit_the_Child_Theme_Files\"><\/span>Edit the Child Theme Files<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The child theme will be created in:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>wp-content\/themes\/astra-child\/\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">You can edit files such as:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>style.css<\/code><\/li>\n\n\n\n<li><code>functions.php<\/code><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Use <code>style.css<\/code> for custom CSS and <code>functions.php<\/code> for custom PHP functions.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Test_the_Website\"><\/span>Test the Website<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">After activating the child theme:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Open the website in your browser.<\/li>\n\n\n\n<li>Check that the layout loads correctly.<\/li>\n\n\n\n<li>Verify that custom styles are applied.<\/li>\n\n\n\n<li>Test key pages and features.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">If something looks broken, switch back to the parent theme and review the child theme files.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Summary\"><\/span>Summary<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Creating a WordPress child theme with WP-CLI is a fast and safe way to customize a website without editing the parent theme directly. Use <code>wp scaffold child-theme<\/code>, activate the new theme, and add your custom changes inside the child theme directory.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n<\/div>","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"template":"","format":"standard","manualknowledgebasecat":[54,58,60],"manual_kb_tag":[8157,8167,8168,8169,190,438,485,1326,1998,2427,2801,2949,7581,8155],"class_list":["post-8182","manual_kb","type-manual_kb","status-publish","format-standard","hentry","manualknowledgebasecat-ssh","manualknowledgebasecat-web-applications-cms","manualknowledgebasecat-wordpress-plugins","manual_kb_tag-parent-theme","manual_kb_tag-wp-cli","manual_kb_tag-create-child-theme","manual_kb_tag-scaffold-child-theme","manual_kb_tag-wordpress","manual_kb_tag-theme-updates","manual_kb_tag-theme-development","manual_kb_tag-command-line","manual_kb_tag-server-access","manual_kb_tag-public-html","manual_kb_tag-theme-activation","manual_kb_tag-theme-customization","manual_kb_tag-theme-update","manual_kb_tag-child-theme"],"_links":{"self":[{"href":"https:\/\/mybox.com\/help\/ro\/wp-json\/wp\/v2\/manual_kb\/8182","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mybox.com\/help\/ro\/wp-json\/wp\/v2\/manual_kb"}],"about":[{"href":"https:\/\/mybox.com\/help\/ro\/wp-json\/wp\/v2\/types\/manual_kb"}],"author":[{"embeddable":true,"href":"https:\/\/mybox.com\/help\/ro\/wp-json\/wp\/v2\/users\/1"}],"version-history":[{"count":2,"href":"https:\/\/mybox.com\/help\/ro\/wp-json\/wp\/v2\/manual_kb\/8182\/revisions"}],"predecessor-version":[{"id":8183,"href":"https:\/\/mybox.com\/help\/ro\/wp-json\/wp\/v2\/manual_kb\/8182\/revisions\/8183"}],"wp:attachment":[{"href":"https:\/\/mybox.com\/help\/ro\/wp-json\/wp\/v2\/media?parent=8182"}],"wp:term":[{"taxonomy":"manualknowledgebasecat","embeddable":true,"href":"https:\/\/mybox.com\/help\/ro\/wp-json\/wp\/v2\/manualknowledgebasecat?post=8182"},{"taxonomy":"manual_kb_tag","embeddable":true,"href":"https:\/\/mybox.com\/help\/ro\/wp-json\/wp\/v2\/manual_kb_tag?post=8182"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}