Complete Tutorial for Creating and Installing Child Themes for Astra Theme

Astra The theme offers powerful customization features, but if you need to make more in-depth changes to the theme, such as tweaking template files or adding custom code, use thesubthemeis a better choice. The child theme is able to inherit all the features of the main theme and at the same time can be freely adjusted without affecting the update of the main theme.

What is the Astra subtopic?

The sub-themes are WordPress An extension of the theme that relies on Astra The theme runs. It inherits all the functionality of the main theme and can be tweaked on top of it without affecting the core code.

Key Benefits of Using Child Themes

  • Avoid losing changes during Astra theme updates
  • Template files and functional code can be modified without affecting the main theme
  • For developers or users who need to customize the theme
Image[1]-Astra child theme creation and installation tutorial: full step-by-step and customization guide

Using Astra's official child theme generator

Astra provides an official child theme generator tool to quickly create child theme files

move

  • The first step is to enter Astra'sChild Theme GeneratorPage. In theSubtopic namefield, enter the name you wish to specify for the subtopic.
Image [2]-Astra child theme creation and installation tutorial: full step-by-step and customization guide
  • strike (on the keyboard) Advanced Options
Image [3]-Astra child theme creation and installation tutorial: full step-by-step and customization guide
  • Fill in the relevant information, including the name of the website, author, website link, etc.
Image [4]-Astra child theme creation and installation tutorial: full step-by-step and customization guide
  • Choose to upload an image as a thumbnail for the child theme (optional)
Image [5]-Astra child theme creation and installation tutorial: full step-by-step and customization guide
  • strike (on the keyboard) Generate button to download .zip Sub-topic files in the format
Image [6]-Astra child theme creation and installation tutorial: full step-by-step and customization guide

Install Astra child theme

create a good ideasubthemeAfter that, you need to install and enable the

  • go into WordPress Backend, click Appearance > Themes
Image [7]-Astra child theme creation and installation tutorial: full step-by-step and customization guide
  • option Add Newthematic
Image [8]-Astra child theme creation and installation tutorial: full step-by-step and customization guide
  • Choose to upload a theme and select the downloaded Astra subtheme file, click Installation
Image [9]-Astra child theme creation and installation tutorial: full step-by-step and customization guide
  • After the installation is complete, click activate
Image [10]-Astra child theme creation and installation tutorial: full step-by-step and customization guide

Check if the Astra child theme is enabled

After the child theme is installed, go to Appearance > Themes web page

  • Astra Child theme displayed on the left Indicates that it has been successfully enabled
  • right-hand display Astra thematic Indicates that the main theme has been installed correctly, but is not activated

Astra child themes need to be supported by the main theme, so the main theme must remain installed, but child themes should be activation state

Image [11]-Astra child theme creation and installation tutorial: full step-by-step and customization guide

Common customizations for Astra child themes

(1) Modification CSS type

If you need to adjust fonts, colors, backgrounds, and other styles, you can do so in the style.css Add custom CSS code, such as

.site-title {
    color: #ff6600;
    color: #ff6600; font-size: 24px;
}

This code changes the color and font size of the website title

(2) Add customized functions

exist functions.php You can add PHP code to it, for example to register a new menu.

function astra_child_custom_menu() {
    register_nav_menu('extra-menu', __('extra-menu'));;
}
add_action('after_setup_theme', 'astra_child_custom_menu');

Impact of sub-themes on Astra theme updates

The existence of child themes does not affect the updating of Astra themes, but it is something to be aware of:

  • If an Astra theme update introduces new features, you may need to manually adapt child themes.
  • If the child theme contains outdated template files, this may cause compatibility issues
  • It is recommended to backup your website before updating the Astra theme to avoid losing changes!

reach a verdict

Astra subthemeThe creation and installation process is relatively simple and can be generated quickly using official tools. After installation, you can modify CSS styles, add new features, and adjust template files to make the site more personalized. During use, it is recommended to make regular backups and keep an eye on the Astra Theme updates to ensure compatibility and stability of child themes


Contact Us
Can't read the tutorial? Contact us for a free answer! Free help for personal, small business sites!
Customer Service
Customer Service
Tel: 020-2206-9892
QQ咨询:1025174874
(iii) E-mail: info@361sale.com
Working hours: Monday to Friday, 9:30-18:30, holidays off
© Reprint statement
This article was written by: thieves will be rats and mice courage
THE END
If you like it, support it.
kudos573 share (joys, benefits, privileges etc) with others
commentaries sofa-buying

Please log in to post a comment

    No comments