0
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.com/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.com/bootstrap/4.4.1/css/bootstrap.min.css');

 }

add_action('wp_enqueue_scripts', 'spartans_styles');
0

You 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.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.