Skip to content

Instantly share code, notes, and snippets.

@iamcanadian1973
Created July 10, 2019 03:42
Show Gist options
  • Save iamcanadian1973/b8f347edac27edaffef6164d1ffff00b to your computer and use it in GitHub Desktop.
Save iamcanadian1973/b8f347edac27edaffef6164d1ffff00b to your computer and use it in GitHub Desktop.
ACF Gallery
(function (document, window, $) {
'use strict';
$("#light-gallery").lightGallery({
selector: '.column',
thumbnail:true,
download: false
});
}(document, window, jQuery));
<?php
add_action( 'wp_enqueue_scripts', '_s_register_scripts' );
function _s_register_scripts() {
// Light Gallery
wp_register_script(
'lightgallery',
'//cdn.jsdelivr.net/combine/npm/lightgallery,npm/lg-autoplay,npm/lg-fullscreen,npm/lg-hash,npm/lg-pager,npm/lg-thumbnail,npm/lg-video,npm/lg-zoom', array('jquery'), '', true );
wp_register_script( 'lightgallery-config', trailingslashit( THEME_JS ) . 'lightgallery-config.js', array('jquery', 'lightgallery' ), '', true );
wp_enqueue_script( 'lightgallery' );
wp_enqueue_script( 'lightgallery-config' );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment