Monday, 26 Oct 2026

Exclusive resources and tools for web design and development experts

Explore
BiblioWeb

Biblioweb.es

All About Web Technology

  • Start
  • WordPress
    WordPress
    • All about WordPress26
    • Plugins de WordPress16
    • Desarrollo web y plugins15
    Rendimiento y seguridad
    • Hosting y rendimiento8
    • Ciberseguridad web7
    • Solución de errores5
    Negocio e IA
    • IA y automatización10
    • WooCommerce y tiendas online6
    Lo último
    Restaurant Menu Widget — WordPress Plugin27 Sep 2026JetStudio Bookings — WordPress Plugin27 Sep 2026SC Heatmap — WordPress Plugin27 Sep 2026
    Ver el blog completoHistorial de noticiasAbout usNewsletter semanal
  • Plugins de WordPress
    Fichas de plugins
    • WP Translate Master
    • Cart Tool Kit
    • SC Heatmap
    • JetStudio Bookings
    • Restaurant Menu Widget
    • WP SEO Pro
    • Rank Math SEO in 2026
    • WP Rocket
    • WPCode
    • AI Engine para WordPress
    Comparativas y guías
    • The best SEO plugins for WordPress
    • The best AI plugins for WordPress
    • The best booking plugins for WordPress
    • WordPress multiidioma
    • Cómo crear un formulario de contacto en WordPress
    • Stripe o PayPal
    Por temática
    • Plugins de WordPress16
    • WooCommerce y tiendas online6
    • Desarrollo web y plugins15
    • IA y automatización10
    • Hosting y rendimiento8
    BibliotecaPlugin Library

    Los plugins de WordPress que desarrollamos: qué hace cada uno, cómo se ve en acción y dónde conseguirlo.

    Entrar en la Pluginteca
    Toda la categoría Plugins de WordPressHerramientas gratis
  • Tools
    Herramientas gratis, sin registro y desde el navegador
    Generador de contraseñasContraseñas largas y aleatorias sin salir del navegador.Generador de QRCódigos QR en PNG de alta resolución, sin caducidad.Contador de palabrasPalabras, caracteres y tiempo de lectura en vivo.JSON FormatterFormatea, valida y localiza el error exacto.WebP ConverterPNG, JPG y PDF a WebP para que la web cargue…PDF a WebPCada página del PDF, en una imagen ligera.Comprobador de emailsSintaxis, correos temporales y registros MX.Compresor de vídeoBaja el peso del vídeo sin subirlo a ningún servidor.Vídeo a MP3Extrae el audio de un vídeo en un par de clics.Firmas de emailFirma en HTML lista para Gmail y Outlook.
    También te sirveHerramientas externas que merecen la pena

    DNS Checker, Query Monitor, Local WP y el resto del kit que usamos a diario, con para qué sirve cada una.

    Ver la selección
    Todas las herramientasPlugin LibraryRecíbelas por correo
  • Plugin Library
  • Español
  • English ✓
  • 🇨🇳 中文(简体)
  • Français
  • Deutsch
  • Italiano
Newsletter
  • WordPress
  • Plugins de WordPress
  • WooCommerce
  • IA para WordPress
  • Security
  • Herramientas gratis
  • See everything
BiblioWebBiblioWeb
Font ResizerAa
  • WordPress
  • Plugins
  • WooCommerce
  • Errores
  • Tools
Search
  • Start
  • WordPress
    • All about WordPress
    • WordPress Plugins
    • Web Development and Plugins
    • AI and Web Automation
    • WooCommerce
    • Hosting and Web Performance
    • Cybersecurity and Web Security
    • Web Error Resolution
  • Plugins de WordPress
    • Rank Math SEO
    • AI Engine
    • WP Rocket
    • WPCode
    • WP Translate Master
    • Cart Tool Kit
    • SC Heatmap
    • JetStudio Bookings
    • Restaurant Menu Widget
    • WP SEO Pro
  • Tools
    • Password Generator
    • QR Code Generator
    • Word Counter
    • JSON Formatter
    • Image to WebP Converter
    • Email Checker
    • Video Compressor for Web
    • Email Signature Generator
    • Video to MP3 Converter
    • PDF to WebP Converter
  • Plugin Library
  • Blog
    • Español
    • English ✓
    • 🇨🇳 中文(简体)
    • Français
    • Deutsch
    • Italiano
Síguenos
© 2026 BiblioWeb — All rights reserved.
Cover » Blog » What is a child theme in WordPress and how to create it
Web Development and Plugins

What is a child theme in WordPress and how to create it

Adrián Alcalá
Actualizado: 08/08/2026 21:10
By Adrián Alcalá
Share
14 min de lectura
What is a WordPress child theme and how to create it
SHARE

If you have ever customized your theme and seen an update erase all your changes, you already know why the child theme WordPress (or child theme). A child theme is a theme that inherits all the design and functionality of another theme (the parent) and allows you to modify only what you want to change: some styles, a template, some functions. The beauty of the invention is that your changes live in a separate folder, so that when the parent theme is updated (and it must be updated, for security and compatibility), your customizations remain intact. It is the official WordPress mechanism for customizing third-party themes, and creating it literally costs two files and five minutes. In this guide, we see what exactly a child theme is, when you really need it (and when not), how to create it step by step with the complete code, how the template hierarchy that makes it possible works, and the typical errors to avoid from the beginning.

Índice
What is a child theme and how inheritance worksWhen you need a child theme (and when not)How to create a WordPress child theme step by stepWhat to customize from the child theme: useful examplesCommon errors with child themesChild themes and block themes: the nuance of 2026Frequently Asked QuestionsConclusion

What is a child theme and how inheritance works

A child theme is a folder inside of wp-content/themes which declares, through a line in its stylesheet, that its parent is another installed theme. From that declaration, WordPress applies a simple and powerful rule:

  • For PHP templates: if the file exists in the child, the child's is used; if not, the parent's is used. Copying header.php from the parent to the child and editing it there replaces the header without touching the original.
  • For styles and functions: are not replaced, they are added. The functions.php of the child is loaded additionally of the parent (and before), and the child's CSS is enqueued alongside the parent's to overwrite specific rules.

The practical result: the parent theme remains the engine (and can be updated normally), while the child acts as a thin layer with your differences. Updating the parent never touches the child's folder, so your changes survive any update.

When you need a child theme (and when not)

Not every customization justifies a child theme. The dividing line is clear:

Yes, you need a child theme if…

  • You are going to edit theme files: PHP templates, or CSS beyond a few adjustments.
  • You want to add design-related functions (register an extra menu, a widget area, image sizes).
  • You maintain client websites where updates must be able to be applied without fear.

You don't need it if…

  • You only want some CSS tweaks: el campo “CSS adicional” del personalizador (o de los estilos globales en temas de bloques) los guarda en la base de datos, a salvo de actualizaciones.
  • Your change is pure functionality (a shortcode, a WooCommerce setting, a tracking snippet): that belongs to a plugin or a snippet manager like WPCode, because it must also survive a theme change.
  • You use a modern block theme and all your changes fit in the site editor: modifications made there are already saved in the database.

The golden rule: design that touches theme files, to the child theme; functionality independent of design, to a plugin. And if you are still choosing a theme, do it also thinking about this: a good, well-maintained theme deserves the small investment of creating a child before customizing. In our guide on how to choose the perfect theme for your WordPress website we review what signals distinguish a solid theme.

How to create a WordPress child theme step by step

Let's create a child theme for an example parent theme; we will use Astra, but the process is identical for any classic theme: only the parent's identifier changes. You need access to the files (SFTP or the hosting manager) or, locally, your file explorer.

You Might Also Like

WordPress Shortcodes: what they are and how to create your own
How to connect Google Sheets with WordPress
How to create a WordPress plugin from scratch
WordPress without coding: what you can build with no-code

Step 1: Create the folder

Inside of wp-content/themes, create a new folder. By convention, the parent's name is used with the suffix -child:

wp-content/themes/astra-child/
├── style.css
└── functions.php

Step 2: Create style.css with the header

The file style.css is mandatory and its comment header is what turns the folder into a theme. The critical line is Template: it must contain the exact name of the parent theme's folder (case-sensitive):

/*
Theme Name:   Astra Child
Theme URI:    https://biblioweb.es/
Description:  Tema hijo de Astra para personalizaciones seguras
Author:       BiblioWeb
Author URI:   https://biblioweb.es/
Template:     astra
Version:      1.0.0
Text Domain:  astra-child
*/

/* A partir de aquí, tus estilos personalizados. */

Step 3: Enqueue the styles in functions.php

Contrary to what was done in the past (with @import, today deprecated due to slowness), the parent's stylesheet is loaded with correct enqueuing from functions.php:

<?php
/**
 * Encolar la hoja de estilos del tema padre y la del hijo.
 */
add_action( 'wp_enqueue_scripts', 'astra_child_enqueue_styles' );
function astra_child_enqueue_styles() {
    // Estilos del padre.
    wp_enqueue_style(
        'astra-parent-style',
        get_template_directory_uri() . '/style.css',
        array(),
        wp_get_theme( get_template() )->get( 'Version' )
    );
    // Estilos del hijo, cargados después para poder sobrescribir.
    wp_enqueue_style(
        'astra-child-style',
        get_stylesheet_directory_uri() . '/style.css',
        array( 'astra-parent-style' ),
        wp_get_theme()->get( 'Version' )
    );
}

Notice the detail of the two twin functions: get_template_directory_uri() always points to the parent y get_stylesheet_directory_uri() to the child. Confusing them is the source of half the problems with child themes. Note: some themes (Astra among them) already enqueue their styles so that the child loads automatically; if you see duplicated styles, simplify enqueuing by leaving only the child's stylesheet with the appropriate dependency.

Step 4: activate and check

Go to Appearance → Themes: verás “Astra Child” como un tema más. Actívalo. La web debe verse exactamente igual que con el padre; si se ve sin estilos, revisa el valor de Template and enqueuing. With this, your WordPress child theme is now active and ready to receive customizations. Optionally, add an image screenshot.png (1200×900) to the child's folder so it displays a thumbnail in the selector.

Step 5 (optional): override templates

To modify a parent template, copy it to the child respecting its relative path and edit it there. For example, to customize the single post template, copy single.php from the parent to the child's root; for a template within subfolders (common in WooCommerce), respect the structure: woocommerce/single-product.php. WordPress will automatically use your copy.

What to customize from the child theme: useful examples

With the structure set up, the child becomes your safe workspace. Some common uses:

Custom styles

/* En style.css del hijo */
.site-title {
    font-size: 2.2rem;
    letter-spacing: -0.02em;
}
.entry-content a {
    text-decoration: underline;
    text-underline-offset: 3px;
}

Design-linked functions

// En functions.php del hijo: registrar un menú adicional.
add_action( 'after_setup_theme', 'astra_child_menus' );
function astra_child_menus() {
    register_nav_menu( 'menu-legal', 'Menú legal del pie' );
}

// Un tamaño de imagen a medida para tarjetas del blog.
add_action( 'after_setup_theme', 'astra_child_image_sizes' );
function astra_child_image_sizes() {
    add_image_size( 'tarjeta-blog', 600, 400, true );
}

Remember the criterion from the previous section: if the snippet does not depend on the design (analytics, redirects, behavior settings), do not put it in the functions.php of the child; move it to its own plugin or a snippet manager, so it survives a future theme change. Many of the essential WordPress plugins exist precisely so you don't have to put everything in the theme.

Common errors with child themes

  • Misspelled Template. If Template: astra no coincide exactamente con el nombre de la carpeta del padre, WordPress mostrará el hijo como “roto”. Es el fallo número uno.
  • Using @import in CSS. It works, but it serializes downloads and penalizes speed. Always enqueue from functions.php.
  • Copying too many templates. Each template copied to the child stops receiving improvements that the parent incorporates in its updates. Copy only what you are actually going to modify, and review your copies when the parent publishes major changes.
  • Confusing functions.php. El del hijo no sustituye al del padre: ambos se cargan. Si declaras una función con el mismo nombre que una del padre no “la sobrescribes”: provocas un error fatal, salvo que el padre la haya envuelto en function_exists().
  • Creating the child after customizing the parent. The correct order is: install parent, create child, activate child, and only then customize. Customizer settings are saved per theme, so activating the child may require reconfiguring some options (or migrating them with a settings export plugin).
  • Editing without a backup. A PHP syntax error in functions.php crashes the website. Edit via SFTP (never from the desktop file editor in production) and have a recent backup to quickly undo changes.

Child themes and block themes: the nuance of 2026

With block themes (Full Site Editing), much of the classic customization (headers, footers, templates) is done visually in the site editor and saved in the database, not in files. This reduces the cases where a child theme is essential, but it doesn't retire it: it's still the correct way to add structured CSS, modify theme.json (the theme's global style settings, which the child can also override), register custom patterns, or modify the parent's HTML templates. The inheritance mechanism works the same: same style.css with its Template, and the child's templates (in the templates/) have priority over those of the parent. The complete reference is in the official child themes manual from developer.wordpress.org.

Frequently Asked Questions

Does a child theme affect WordPress performance?

The impact is negligible: an additional stylesheet (often tiny) and a functions.php extra. Well-built, with correct enqueuing and without @import, a child theme does not measurably slow down the website.

Can I create a child theme of a child theme?

No. WordPress only supports one level of inheritance: a child cannot be the parent of another theme. If you need variants, work with a single, well-organized child or consider a different approach (custom templates, customization plugin).

What happens if I change the parent theme?

The child is tied to its specific parent: if you activate another theme, the child stops working as is. Styles and templates are rarely transferable (they depend on the parent's classes and structure), but design-independent functions are, another reason to keep them in a plugin and not in the theme.

Are there plugins that create the child theme for me?

Yes, plugins like Child Theme Configurator generate the structure with one click and even migrate customizer settings from parent to child. They are a legitimate option if you don't want to touch files, although as you've seen, the manual process involves two files and five minutes, and understanding it will help you every time something doesn't add up.

Conclusion

The WordPress child theme is one of those small pieces that define the difference between customizing well and customizing with an expiration date. Two files (style.css with its header and functions.php with enqueuing) are enough to separate your changes from the original theme and protect them from updates. The rules for not making mistakes fit into three lines: create the child before customizing, copy only the templates you actually modify to the child, and reserve the functions.php of the theme for design functions, leaving general functionality to plugins. If your website uses a third-party theme and you plan to touch a single line of its files, don't hesitate: set up the child theme today. It's the most profitable five-minute investment in the WordPress ecosystem.

Share This Article
Email Copiar enlace Print
ByAdrián Alcalá
Síguele:
Adrián Alcalá es desarrollador WordPress y consultor SEO, autor del plugin WP Translate y creador de BiblioWeb. Desde aquí comparte guías, tutoriales y herramientas gratuitas para quienes crean, optimizan y posicionan páginas web. Lleva años ayudando a negocios de toda España a sacar el máximo partido a WordPress, y todo lo que publica está probado en proyectos reales.
Previous Article Gutenberg block editor guide WordPress Block Editor Guide (Gutenberg)
Next Article WordPress Hooks: actions and filters explained WordPress Hooks: what actions and filters are
Ilustración del plugin Restaurant Menu Widget: carta de restaurante con platos y precios editables en Elementor
Restaurant Menu Widget — WordPress Plugin
WordPress Plugins
Ilustración del plugin JetStudio Bookings: formulario de citas por pasos con calendario y bandeja de solicitudes
JetStudio Bookings — WordPress Plugin
WordPress Plugins
Ilustración del plugin SC Heatmap: mapa de calor de clics y scroll sobre una web, con los datos en tu servidor
SC Heatmap — WordPress Plugin
WordPress Plugins
Accesibilidad web en WordPress con IA
Accesibilidad web en WordPress: auditarla con IA en una tarde
AI & Web Automation

También te puede interesar

WordPress Plugins - Don't start without them The 5 Essential WordPress Plugins every beginner needs for a top-notch website
Web Development and Plugins

The 5 essential WordPress plugins for beginners

28/09/2026
Internal tools for web agencies
Web Development and Plugins

Internal tools for web agencies: when and how to create them

08/08/2026
Install Yoast SEO - Goodbye SEO Chaos Install Yoast SEO in WordPress and Activate Your Superpower for Google (Quick and Fun Guide
Web Development and Plugins

How to install and configure Yoast SEO in WordPress

28/09/2026
Design WordPress Website - Design your PRO Website in WordPress: The Perfect Theme for a Brutal Impact (and AI tricks that will blow your mind
Web Development and Plugins

How to choose the perfect theme to design your website in WordPress

28/09/2026
Show More
  • Temas:
  • WordPress
  • WordPress Plugins
  • Web Development and Plugins
  • AI & Web Automation
  • Web Hosting & Performance
  • Cybersecurity and Web Security
  • WooCommerce
  • Troubleshooting web errors
BiblioWeb

Biblioweb.es

Web Technology News

Information you can trust: practical web technology guides and solutions — WordPress, plugins, cybersecurity, hosting, performance, and error troubleshooting.

RSS

Enlaces de interés

  • About us
  • Contact
  • Free tools
  • Plugin Library

Recibe nuestras nuevas guías de WordPress en tu correo. Suscríbete a la newsletter.

Legal

  • Legal Notice
  • Terms and Conditions
  • Cookies Policy
  • Privacy Policy

Últimas novedades

Ilustración del plugin Restaurant Menu Widget: carta de restaurante con platos y precios editables en Elementor

Restaurant Menu Widget — WordPress Plugin

27/09/2026
Continue reading
Ilustración del plugin JetStudio Bookings: formulario de citas por pasos con calendario y bandeja de solicitudes

JetStudio Bookings — WordPress Plugin

27/09/2026
Continue reading

© 2026 BiblioWeb — All rights reserved.

Gestionar consentimiento
Utilizamos tecnologías como las cookies para almacenar y/o acceder a la información del dispositivo. Lo hacemos para mejorar la experiencia de navegación y para mostrar anuncios (no) personalizados. El consentimiento a estas tecnologías nos permitirá procesar datos como el comportamiento de navegación o los ID's únicos en este sitio. No consentir o retirar el consentimiento, puede afectar negativamente a ciertas características y funciones.
Funcional Always active
El almacenamiento o acceso técnico es estrictamente necesario para el propósito legítimo de permitir el uso de un servicio específico explícitamente solicitado por el abonado o usuario, o con el único propósito de llevar a cabo la transmisión de una comunicación a través de una red de comunicaciones electrónicas.
Preferences
El almacenamiento o acceso técnico es necesario para la finalidad legítima de almacenar preferencias no solicitadas por el abonado o usuario.
Estadísticas
El almacenamiento o acceso técnico que es utilizado exclusivamente con fines estadísticos. El almacenamiento o acceso técnico que se utiliza exclusivamente con fines estadísticos anónimos. Sin un requerimiento, el cumplimiento voluntario por parte de tu proveedor de servicios de Internet, o los registros adicionales de un tercero, la información almacenada o recuperada sólo para este propósito no se puede utilizar para identificarte.
Marketing
El almacenamiento o acceso técnico es necesario para crear perfiles de usuario para enviar publicidad, o para rastrear al usuario en una web o en varias web con fines de marketing similares.
  • Manage options
  • Manage services
  • Manage {vendor_count} vendors
  • Read more about these purposes
Ver preferencias
  • {title}
  • {title}
  • {title}
Accede a BiblioWeb
Usuario o correo electrónico
Contraseña

¿Has olvidado tu contraseña?