function spartans_styles(){
wp_enqueue_style( 'maincss', get_stylesheet_uri());
wp_enqueue_style('mybootstrap', get_template_directory_uri() . '/assets/css/mybootstrap.css');
wp_enqueue_script('myscript', get_template_directory_uri() . '/assets/js/spartanscripts.js');
wp_enqueue_style('custom', get_template_directory_uri(). '/assets/css/custom.css');
wp_enqueue_style('GoogleFonts', ';display=swap');
wp_enqueue_style('editor-styles', get_template_directory_uri(). '/assets/css/editor-style.css');
wp_enqueue_style( 'bootstrap', get_template_directory_uri() . '/assets/css/mybootstrap.css', array(), '1.1', 'all');
// wp_enqueue_style('bootstrapcdn', '.4.1/css/bootstrap.min.css');
}
add_action('wp_enqueue_scripts', 'spartans_styles');
function spartans_styles(){
wp_enqueue_style( 'maincss', get_stylesheet_uri());
wp_enqueue_style('mybootstrap', get_template_directory_uri() . '/assets/css/mybootstrap.css');
wp_enqueue_script('myscript', get_template_directory_uri() . '/assets/js/spartanscripts.js');
wp_enqueue_style('custom', get_template_directory_uri(). '/assets/css/custom.css');
wp_enqueue_style('GoogleFonts', 'https://fonts.googleapis/css?family=Roboto&display=swap');
wp_enqueue_style('editor-styles', get_template_directory_uri(). '/assets/css/editor-style.css');
wp_enqueue_style( 'bootstrap', get_template_directory_uri() . '/assets/css/mybootstrap.css', array(), '1.1', 'all');
// wp_enqueue_style('bootstrapcdn', 'https://stackpath.bootstrapcdn/bootstrap/4.4.1/css/bootstrap.min.css');
}
add_action('wp_enqueue_scripts', 'spartans_styles');
Share
Improve this question
edited Feb 10, 2020 at 18:56
butlerblog
5,1213 gold badges28 silver badges44 bronze badges
asked Feb 10, 2020 at 16:34
Barot UdayBarot Uday
11 bronze badge
1 Answer
Reset to default 0You will need to add . '/style.css'
to you first enqueue to actually load that file. Also, depending on your server's settings you may encounter problems with loading edited versions of your style sheets if you don't include a version number as the fourth parameter to wp_enqueue_style
.
Finally, you may want to check your code whether you are registering the same handles with different parameters elsewhere (for instance in a parent theme). If they are registered first with a dependency (third parameter) and that file isn't loaded, then these will not enqueue either.