Unclear console error

I’m getting this error when trying to enqeue script and styles:
enter image description here

This is the code in functions.php:

Read More
add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' );
function theme_enqueue_styles() {
    wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );

    wp_enqueue_style( 'slik-slider-style', get_stylesheet_directory_uri() . '/js/slik/slick-theme.css' );
    wp_enqueue_style( 'slik-slider-style-2', get_stylesheet_directory_uri() . '/js/slik/slick.css' );

}
function theme_enqueue_scripts(){
    wp_enqueue_script( 'slik-slider-js', get_stylesheet_directory_uri() . '/js/slik/slick.min.js' );
}
add_action( 'wp_enqueue_scripts', 'theme_enqueue_scripts' );

The files are all in places, I have no idea why i’m getting this error…

Any help will be appreciated.

Thanks!

Related posts

1 comment

  1. There are two things that I see.

    First are the two missing css file in the javascript (/js/) folder or are they in a css (/css/) folder. If they are in that path great, if not change the paths to those files.

    Second try the following

    add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' );
    function theme_enqueue_styles() {
        wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
    
        wp_enqueue_style( 'slik-slider-style', get_template_directory_uri() . '/js/slik/slick-theme.css' );
        wp_enqueue_style( 'slik-slider-style-2', get_template_directory_uri() . '/js/slik/slick.css' );
    
    }
    function theme_enqueue_scripts(){
        wp_enqueue_script( 'slik-slider-js', get_template_directory_uri() . '/js/slik/slick.min.js' );
    }
    add_action( 'wp_enqueue_scripts', 'theme_enqueue_scripts' );
    

    Hope this helps.

    Best,

    Tim

Comments are closed.