jQuery(...).nivoSlider is not a function on reload

37 views Asked by At

I'm using a theme on Wordpress that uses the Nivoslider. It works fine when you initially go to the page, but whenever you reload the page, you get this error message:

jQuery(...).nivoSlider is not a function

I can't figure out why. It says that the else part is wrong in the code:

jQuery(window).load(function() {
        if(jQuery('#slider') > 0) {
        jQuery('.nivoSlider').nivoSlider({
            effect:'fade',
    });
        } else {
            jQuery('#slider').nivoSlider({
            effect:'fade',
    });
        }
});

But I can't see how it could be an issue. It seems to be more of a **caching **issue, as if you got developer tools up it works fine.

Anyone got any ideas? I was wondering if it was perhaps the jQuery version that had gotten updated, as it has worked flawlessly before. It would've been updated without me knowing if that was the case. The current jQuery version was 3.6.0 (gotten by using console.log(jQuery().jquery) in the console).

The theme I'm using is SKT Cutsnstyle Lite.

0

There are 0 answers