Hi I troubling with creating a working child-theme. I tried following the codex.wordpress and adjusted everything like below. But when I then activate the child theme in wordpress, the website is not working anymore and just white.
Do you see a mistake somewhere here? Thank you very much in advance!
style.css of the child
/*
Theme Name: flatsome-child-newest
Description: This is a child theme for Flatsome Theme
Author: UX Themes
Template: flatsome-newest
Version: 3.0
*/
functions.php of the child
<?php
// Enqueue stylesheets and dependencies
$parent_style = 'flatsome-style';
add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles' );
function my_theme_enqueue_styles() {
wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
}
function my_theme_enqueue_styles() {
wp_enqueue_style( $parent_style, get_template_directory_uri() . '/style.css' );
wp_enqueue_style( 'child-style',
get_stylesheet_directory_uri() . '/style.css',
array( $parent_style ),
wp_get_theme()->get('Version')
);
}
add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles' );
**and some custom code**
Template: flatsome-newest
you have the name of the parent theme, not the name of its directory?Template: flatsome
instead if you not already tried that. Also as you are having multiple folders of the flatsome theme, make sure that they dont have the same theme name inside the style.css files.