Skip to content

Instantly share code, notes, and snippets.

@wplit
Created December 28, 2019 02:10
Show Gist options
  • Select an option

  • Save wplit/662dc9f23b170f3b4ed6fd92a00c1476 to your computer and use it in GitHub Desktop.

Select an option

Save wplit/662dc9f23b170f3b4ed6fd92a00c1476 to your computer and use it in GitHub Desktop.
Carousel/Slider from WordPress Gallery using Flickity (updated flickity-init.js)
(function ($) {
$('.gallery-carousel .blocks-gallery-grid').flickity({
// At the end of cells, wrap-around to the other end for infinite scrolling.
wrapAround: true,
// Align cells within the carousel element.
cellAlign: 'left',
// Groups cells together in slides. Flicking, page dots, and previous/next buttons are mapped to group slides, not individual cells. is-selected class is added to the multiple cells in the selected slide.
// if set to a number, group cells by that number.
groupCells: 2
});
})(jQuery);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment