<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: WebLearnCraft</title>
    <description>The latest articles on DEV Community by WebLearnCraft (@weblearncraft).</description>
    <link>https://dev.to/weblearncraft</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4244959%2F96251e8b-5213-4e7a-9e14-6407962aba75.png</url>
      <title>DEV Community: WebLearnCraft</title>
      <link>https://dev.to/weblearncraft</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/weblearncraft"/>
    <language>en</language>
    <item>
      <title>How to Create a WordPress Child Theme (Without Losing Your Customizations)</title>
      <dc:creator>WebLearnCraft</dc:creator>
      <pubDate>Sat, 14 Nov 2026 19:02:41 +0000</pubDate>
      <link>https://dev.to/weblearncraft/how-to-create-a-wordpress-child-theme-without-losing-your-customizations-2bgk</link>
      <guid>https://dev.to/weblearncraft/how-to-create-a-wordpress-child-theme-without-losing-your-customizations-2bgk</guid>
      <description>&lt;p&gt;You tweak your theme's CSS, the site looks perfect — then an update arrives and every change is gone. That happens because your edits lived in the parent theme's files, and the update replaced those files.&lt;/p&gt;

&lt;p&gt;A child theme fixes this. It is a small, separate theme that inherits everything from the parent but keeps your edits in their own folder. Updates replace the parent, never the child.&lt;/p&gt;

&lt;h2&gt;
  
  
  Do you actually need one?
&lt;/h2&gt;

&lt;p&gt;If you only build pages in Elementor, probably not — Elementor settings live in the database, not in theme files. But the moment you want to edit a theme file — CSS in style.css, a PHP function, or a template like header.php — a child theme is the safe way to do it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Before you start
&lt;/h2&gt;

&lt;p&gt;Back up your files and database first. If your host offers a staging site, do this there first. And make sure you can reach your files (File Manager or FTP) — a PHP typo can lock you out of the dashboard, and you will need file access to fix it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: Find the parent theme's folder name
&lt;/h2&gt;

&lt;p&gt;Open &lt;code&gt;wp-content/themes/&lt;/code&gt; in File Manager or FTP and find your parent theme's folder. For Hello Elementor it is &lt;code&gt;hello-elementor&lt;/code&gt;. For Astra it is &lt;code&gt;astra&lt;/code&gt;. Write down the exact folder name, hyphens and all — you will need it in a minute.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2: Create the child folder
&lt;/h2&gt;

&lt;p&gt;Next to the parent folder (not inside it), create a new folder called &lt;code&gt;hello-elementor-child&lt;/code&gt;. It needs just two files to start:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;hello-elementor-child/
├── style.css
└── functions.php
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Step 3: Write style.css
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;style.css&lt;/code&gt; starts with a comment header that tells WordPress this is a child theme. The line that matters most is &lt;code&gt;Template&lt;/code&gt; — it must match the parent folder name exactly:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="cm"&gt;/*
Theme Name: Hello Elementor Child
Description: Child theme for Hello Elementor
Author: Your Name
Template: hello-elementor
Version: 1.0.0
*/&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;Template: hello-elementor&lt;/code&gt; — not "Hello Elementor", not the child folder name. Get this wrong and WordPress will say the parent is missing. Your own CSS goes below this comment.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 4: Add functions.php
&lt;/h2&gt;

&lt;p&gt;This file loads the child's stylesheet. For Hello Elementor, the parent already loads its own stylesheet, so we only enqueue the child's CSS, listing the parent's style as a dependency:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;lt;?&lt;/span&gt;&lt;span class="n"&gt;php&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt; &lt;span class="nf"&gt;defined&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="s1"&gt;'ABSPATH'&lt;/span&gt; &lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nb"&gt;exit&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;wlc_child_enqueue_styles&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nf"&gt;wp_enqueue_style&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="s1"&gt;'wlc-hello-child-style'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="nf"&gt;get_stylesheet_uri&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="kt"&gt;array&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="s1"&gt;'hello-elementor-theme-style'&lt;/span&gt; &lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="nf"&gt;wp_get_theme&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="s1"&gt;'Version'&lt;/span&gt; &lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nf"&gt;add_action&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="s1"&gt;'wp_enqueue_scripts'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'wlc_child_enqueue_styles'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;20&lt;/span&gt; &lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Two details: the file must start with &lt;code&gt;&amp;lt;?php&lt;/code&gt; and nothing before it, and the dependency handle (&lt;code&gt;hello-elementor-theme-style&lt;/code&gt;) is specific to Hello Elementor — other themes use different handles, so check your theme's docs before copying this.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 5: Upload and activate
&lt;/h2&gt;

&lt;p&gt;Zip the &lt;code&gt;hello-elementor-child&lt;/code&gt; folder, then in WordPress go to Appearance → Themes → Add New Theme → Upload Theme and pick the ZIP. (FTP works too — upload the folder straight into &lt;code&gt;themes/&lt;/code&gt;.) Find the child theme in the list and activate it. Keep the parent theme installed — the child cannot work without it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 6: Check everything
&lt;/h2&gt;

&lt;p&gt;Visit your homepage, a post page, and the mobile view. Check menus, widgets, logo, header and footer — a child theme can have its own settings, so something may need re-selecting. If the layout looks off, re-activate the parent; your child folder stays safe, it just won't be used while the parent is active.&lt;/p&gt;

&lt;h2&gt;
  
  
  Mistakes to avoid
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Deleting the parent theme (the child depends on it).&lt;/li&gt;
&lt;li&gt;Misspelling the &lt;code&gt;Template&lt;/code&gt; value.&lt;/li&gt;
&lt;li&gt;Copying the parent's whole &lt;code&gt;functions.php&lt;/code&gt; into the child — WordPress loads both, so duplicate functions cause a fatal error.&lt;/li&gt;
&lt;li&gt;Loading the parent stylesheet a second time.&lt;/li&gt;
&lt;li&gt;Editing without a backup or a way back into your files.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That's the whole setup: two files, one exact folder name, and your customizations survive every update. If you want the longer version with troubleshooting, template overrides and FAQs, the full step-by-step guide is on WebLearnCraft: &lt;a href="https://weblearncraft.com/create-a-wordpress-child-theme/" rel="noopener noreferrer"&gt;How to Create a WordPress Child Theme Step by Step&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;And if your next customization is a script rather than CSS, here's the safe way to &lt;a href="https://weblearncraft.com/how-to-add-javascript-to-wordpress-without-a-plugin-3-safe-ways/" rel="noopener noreferrer"&gt;add JavaScript to WordPress without a plugin&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>wordpress</category>
      <category>webdev</category>
      <category>php</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
