public9nf
public9nf

Reputation: 1399

TypeError: $container.isotope is not a function (Wordpress & Isotope)

I have a problem with isotope & wordpress. Im using an easy script which is not working when integrated into wordpress. I get the following error:

TypeError: $container.isotope is not a function". This is the code:

jQuery(function($) {
    /* ISOTOPE */
    var $container = $('.flex-grid');
    $container.isotope({
        itemSelector: '.grid-item',
        percentPosition: true,
        isAnimated: false,
        transitionDuration: 0,
        masonry: {
            columnWidth: '.grid-sizer',
        }
    });
});

The script is loaded in the side footer as the last script.

Upvotes: 2

Views: 9289

Answers (1)

Amila Jayasuriya
Amila Jayasuriya

Reputation: 67

you need to import isotope.js scripts after importing jQuery

get it from here

https://isotope.metafizzy.co/#cdn

Upvotes: 5

Related Questions