
Creating a Child Theme in Avada
- March 31, 2017
- Leave a comment
In WordPress, you can create Child Theme of any parent theme that is installed in your WordPress website. A Child Theme can extend the functionality of a Parent Theme. You can utilize a Child Theme to customize the layout or design of your website without changing the parent theme. In this article, you will learn how to create a child theme in Avada as it is one of the highest purchased WordPress theme.
Creating a child theme for Avada is same as creating any child theme in WordPress. You need to follow the steps mentioned below:
- Create a folder in your WordPress theme directory with the name Avada-Child-Theme
- Now create the following two files and place them in Child theme folder i.e. Avada-Child-Theme folder:
a) style.css
b) functions.php - Now add some code in these files:
a) Open style.css file, add the following code and later modify it according to your scenario:
123456789/*Theme Name: Avada ChildDescription: Child theme for Avada themeAuthor: ThemeFusionAuthor URI: https://theme-fusion.comTemplate: AvadaVersion: 1.0.0Text Domain: Avada*/
b) Note the Template value i.e. Avada. It is the parent theme folder name. Therefore, this should be your parent theme folder name in order to use its functionality in child theme.
c) You can then change all others names according to your need like name, description, author, author uri and version.
d) Now open functions.php file, add the following code and later modify it according to your scenario:
123456<?phpfunction theme_enqueue_styles() {wp_enqueue_style( 'avada-parent-stylesheet', get_template_directory_uri() . '/style.css' );}add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' );?>
e) This code will add the parent style.css file in your child theme. - Now add a new or override parent CSS in your child theme’s style.css file
- In the same way, override the parent template
- Activate your child theme
You have successfully created a child theme for Avada. If you want to change any template of your parent theme then follow the steps mentioned below:
- Copy any template file from your parent theme folder and copy it in the child theme folder
- Change the file code according to your need
- Now WordPress will find the template in your child theme at first. If found then the template from your child theme will be executed or else the parent theme template will be executed
If you want to add some admin functionality in your Avada child theme, you need to write code in your child theme’s functions.php file.
Extending Avada Theme Options
If you want to extend the Avada theme options panel, you can utilize Redux options framework hooks. You just need to write those hooks in your child theme’s functions.php file.
As Avada use Redux for its options panel, run the following code to extend theme options from child theme for Avada theme:
1 |
add_filter('avadaredux/options/avada_theme_options/sections', 'pt_custom_redux_section'); |
Here pt_custom_redux_section is just a function name (for our case) and you can change this according to your need.
Can I use a plugin instead to create an Avada child theme? Thanks
Hello Juan,
It depends upon your requirements. If you want to customize theme’s templates then child theme approach is best.
If you want to customize the functionality of the parent theme then you can create a plugin and customize it using provided hooks.
Thanks for reaching us out. Let us know if you need our further assistance.
Regards,
—
Abdullah | WP Plugin Developer
Email: support@presstigers.com
is dis built with avada? 😀