1) Create the child theme folder

  • Go to /wp-content/themes/
  • Create a new folder named <parent-slug>-child

Example: if the parent theme folder is astra, make astra-child.

The parent slug must match the parent theme’s folder name, not its display name.


2) Add style.css (required)

Create /wp-content/themes/<parent-slug>-child/style.css with this header (edit values):

/*
 Theme Name: Astra Child
 Template: astra
 Text Domain: astra-child
 Description: Child theme for Astra
 Author: Your Name/Company
 Version: 1.0.0
*/

The Template: value must equal the parent theme’s folder (e.g., astra, hello-elementor, twentytwentyfive).


3) (Classic themes) Enqueue styles in functions.php

If your parent is a classic theme (most non-FSE themes), create /wp-content/themes/<parent-slug>-child/functions.php:

<?php
add_action( 'wp_enqueue_scripts', function () {
    // Load parent style first.
    wp_enqueue_style(
        'parent-style',
        get_template_directory_uri() . '/style.css',
        [],
        wp_get_theme( get_template() )->get( 'Version' )
    );

    // Then child style.
    wp_enqueue_style(
        'child-style',
        get_stylesheet_uri(),
        [ 'parent-style' ],
        wp_get_theme()->get( 'Version' )
    );
} );

Don’t use @import in CSS. Always enqueue.


4) Activate the child theme

  • In wp-admin → Appearance → Themes
  • You should see “YourTheme Child” with your screenshot (optional). Activate it.

Optional: Add /screenshot.png (1200×900 px recommended) so it looks nice in the admin.


5) Customize safely

  • Classic themes: Copy only the template file you need from the parent into the child (keep the same relative path), then edit. Example: copy header.php → child theme header.php.
  • Put custom PHP (hooks/filters) in the child’s functions.php. Do not duplicate parent function names—use actions/filters instead.

WP-CLI is a command-line tool for managing WordPress websites. You can install plugins, themes, create users, and much more—all without using a browser. Follow these steps to set it up on your Windows PC with Laragon.

1. Check PHP Path

Open Laragon Terminal (Menu -> Terminal) and run:

where php

This shows the path to your PHP. Example:

C:\laragon\bin\php\php-8.1.10-Win32-vs16-x64\php.exe

We’ll put WP-CLI in this same folder so Windows finds it.


2. Put wp-cli.phar in PHP Folder

Run these commands (adjust version number to your PHP folder name):

cd C:\laragon\bin\php\php-8.1.10-Win32-vs16-x64
curl -o wp-cli.phar https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar

Now you’ll have:

C:\laragon\bin\php\php-8.1.10-Win32-vs16-x64\wp-cli.phar

3. Create wp.bat

In the same folder (php-8.1.10-Win32-vs16-x64), create a new file named wp.bat with this content:

@ECHO OFF
php "C:\laragon\bin\php\php-8.1.10-Win32-vs16-x64\wp-cli.phar" %*

(📌 Replace the path if your PHP version folder is different)


4. Test WP-CLI

Close and reopen laragon Terminal, then run:

wp --info

You should now see something like:

OS: Windows NT 10.0
Shell: cmd.exe
PHP binary: C:\laragon\bin\php\php-8.1.10-Win32-vs16-x64\php.exe
WP-CLI root dir: phar://wp-cli.phar/vendor/wp-cli/wp-cli
WP-CLI version: 2.10.0

✅ That’s it — now wp will work from anywhere in Laragon terminal.

A WordPress theme controls the look, layout, and functionality of your website. Installing a theme is simple, and there are two main methods: via WordPress Dashboard and manual installation.

Method 1: Install a WordPress Theme via Dashboard

This is the easiest method, ideal for free themes from the WordPress repository.

Step 1: Log in to WordPress Admin

Open your browser and go to:

Enter your username and password.

Click Log In.

After login, you’ll see the WordPress dashboard, which is the central hub for managing your website.