Hi Simon,
Thank you for contacting us and I'd be happy to assist.
As the errors suggest, the function of the same name cannot be declared again.
In your code snippet named "fix-bootstrap-conflicts-with-avada" (Toolset custom code section), a function with name "theme_enqueue_styles" is already defined.
But, the function with the same name is also added in the "functions.php" file of the Avada Child theme. This is why, when that child theme is activated, it results in that error.
You can merge the code of the two functions in one place, for example, remove the code snippet "fix-bootstrap-conflicts-with-avada" and update the function in the "functions.php" file to:
function theme_enqueue_styles() {
wp_enqueue_style('child-style', get_stylesheet_directory_uri() . '/style.css', array('avada-stylesheet') );
wp_enqueue_style('toolset_bootstrap_4-css', get_site_url().'/wp-content/plugins/types/vendor/toolset/toolset-common/res/lib/bootstrap4/css/bootstrap.min.css?ver=4.3.1');
}
add_action('wp_enqueue_scripts', 'theme_enqueue_styles');
Alternatively, if you'd prefer to have two independent functions, you can rename the function in the code snippet "fix-bootstrap-conflicts-with-avada" to something other than "theme_enqueue_styles":
function fix_bootstrap_conflicts_enqueue_styles() {
wp_enqueue_style('child-style', get_stylesheet_directory_uri() . '/style.css', array('avada-stylesheet') );
wp_enqueue_style('toolset_bootstrap_4-css', get_site_url().'/wp-content/plugins/types/vendor/toolset/toolset-common/res/lib/bootstrap4/css/bootstrap.min.css?ver=4.3.1');
}
add_action('wp_enqueue_scripts', 'fix_bootstrap_conflicts_enqueue_styles');
I hope this helps and please let me know if you need any further assistance around this.
regards,
Waqar