I know this topic is old hat, but I still got issues with that. I use the elementor child-theme and try to enqueue the following stylesheets
function hello_elementor_child_enqueue_scripts() {
wp_enqueue_style( 'hello-elementor-child-style', get_stylesheet_directory_uri() . '/style.css', ['hello-elementor-theme-style',],'1.0.0');
wp_register_style( 'test', get_template_directory_uri() . '/assets/css/style.css' );
wp_enqueue_style( 'test' );
}
add_action( 'wp_enqueue_scripts', 'hello_elementor_child_enqueue_scripts' );
I tried several other ways like described here: How Can I Use A Child Theme Effectively When Parent's CSS Is Located in a 'CSS folder'?
If I use this standard, my page gets blank:
add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' );
function theme_enqueue_styles() {
wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
}
I know this topic is old hat, but I still got issues with that. I use the elementor child-theme and try to enqueue the following stylesheets
function hello_elementor_child_enqueue_scripts() {
wp_enqueue_style( 'hello-elementor-child-style', get_stylesheet_directory_uri() . '/style.css', ['hello-elementor-theme-style',],'1.0.0');
wp_register_style( 'test', get_template_directory_uri() . '/assets/css/style.css' );
wp_enqueue_style( 'test' );
}
add_action( 'wp_enqueue_scripts', 'hello_elementor_child_enqueue_scripts' );
I tried several other ways like described here: How Can I Use A Child Theme Effectively When Parent's CSS Is Located in a 'CSS folder'?
If I use this standard, my page gets blank:
add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' );
function theme_enqueue_styles() {
wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
}
get_template_directory_uri
always refers to the parent theme. get_stylesheet_directory_uri
refers to the currently active theme, which in this case is the child theme.