Logo
Services - Code - Javascript
Services - Code - Javascript

sampWPgallery

This Javascript snippet transforms regular WordPress (Guttenberg) gallery into Google style image browser.

Simple installation

CSS

<link rel='stylesheet' href='sampwpgallery.css' type='text/css' />

Javascript

<script type='text/javascript' src='sampwpgallery.js' async='async'></script>
<script>

window.onload = function(evt){
        if(jQuery().sampGallery) {
                if(jQuery('.wp-block-gallery').length > 0){
                    jQuery('.wp-block-gallery').sampGallery();
                }
        }
};
</script>

Admin setup

If you need to exclude a gallery from sampWPgallery in your post/page, just add sampgallery-exclude to Additional CSS class(es)-field.

Read also