jquery slick slider is undefined using wordpress

Viewed 27

I am trying to implement a slick slider in a wordpress website. the jquery isnt working. Am i doing something wrong because im not seeing a error.

 ;(function($){
class SlickCarousel {
    constructor() {
        this.initiateCarousel();
    }

    initiateCarousel() {
        console.log('works');
        $('.post-carousel').slick();
    }
}
new SlickCarousel(); })(jQuery);
1 Answers

replace $ with jQuery in all instances - the $ conflicts with WP code.

Related