Answer the question
In order to leave comments, you need to log in
What's wrong with these wordpress styles?
Styles are not applied on the WordPress site .
All paths are correct. There is another test site where everything works and there are no problems with it. Immediately I do not understand
There is a parent theme. There is a child: (the file is connected)
function my_scripts() {
// Theme stylesheet.
wp_enqueue_style('eloboost-child-style', get_stylesheet_directory_uri().'/style.css');
}
add_action( 'wp_enqueue_scripts', 'my_scripts' );
<link rel="stylesheet" type="text/css" href="<?php echo get_stylesheet_directory_uri(); ?>/style.css" media="all" />
Answer the question
In order to leave comments, you need to log in
Try to create a css file in the wordpress root folder and copy the style.css file there
and include
function my_scripts() {
wp_enqueue_style('eloboost-child-style', get_stylesheet_directory_uri().'/css/style.css');
}
add_action( 'wp_enqueue_scripts', 'my_scripts' );
Correct connection of the style.css file
add_action( 'wp_enqueue_scripts', 'theme_scripts' );
function theme_scripts() {
wp_enqueue_style( 'theme-style', get_stylesheet_uri(), array(), filemtime( get_theme_file_path( '/style.css' ) ) );
}
get_stylesheet_uri()
will receive a link to the styles of the child theme, and not the parent theme Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question