skip to Main Content

I want to creat child theme in wordpress manual. Although child themes are available on internet, but I think they are riskey for my website. So, I want to creat chid theme by myself. Am I right?

Writing my own child theme

2

Answers


    1. Create a Folder:

      • In the wp-content/themes/ directory, make a new folder for your child theme (e.g., my-child-theme).
    2. Create style.css:

      • Inside the child theme folder, create a style.css file with essential theme information and a reference to the parent theme.
    3. Add functions.php:

      • In the same folder, add a functions.php file for customizations. This is optional but often used for adding functions or enqueuing styles.
    4. Activate Child Theme:

      • Go to the WordPress Dashboard, navigate to Appearance > Themes, and activate your child theme.

    Now, your child theme is active, and you can customize it without modifying the parent theme.

    Suppose, your child theme is named "my-child-theme," the directory structure would look like this:

    wp-content/themes/
    |-- parent-theme/  (your parent theme folder)
    |-- my-child-theme/
    |   |-- style.css
    |   |-- functions.php
    

    You can use online generator as well here is link : https://childtheme-generator.com/

    Login or Signup to reply.
  1. The absolute minimum you need is a style.css file in a child theme folder that’s inside the "themes" folder of your wordpress installation. That css file needs to have some meta information in a short section at its top (all written in comments), especially the theme name. And it needs to be enqued.

    Everything else is optional, so if you just want to add or change some CSS, that’s enough. But of course, there’s plenty other stuff you can add.

    For details, see the official documentation at https://developer.wordpress.org/themes/advanced-topics/child-themes/

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search