The library can be installed from here [https://github.com/dimsemenov/Magnific-Popup].
via Bower bower install magnific-popup --save
These are some notes as to how to use Magnific Popup with Ole Fredrik's FoundationPress which is is a WordPress starter theme based on Foundation 6 by Zurb [https://foundationpress.olefredrik.com].
gulpfile.js
// Include your own custom scripts (located in the custom folder)
'assets/javascript/custom/*.js',
'assets/components/magnific-popup/dist/jquery.magnific-popup.min.js',
foundation.scss
// Libraries
@import '../components/magnific-popup/dist/magnific-popup';
The two main ways to add images for use in a lightbox in WordPress are through an ACF field group or through the WYSIWYG editor.
_magnific-popup-event-listener.js will handle images added through an ACF field group.
_wordpress-magnific-popup-event-listener.js will handle images added with the Add Media button in the WYSIWYG.
Adding images this way requires the user to set some image setting through the Media Manager interface.
Image CSS Class
should be thumbnail
Link CSS Class
should be lightbox
The image caption is used to display the caption underneath the image and the alt
text is used as the lightbox popup description.
_wordpress-gallery-magnific-popup-event-listener.js will handle images added with [gallery]
shortcode. This may also require the use of the sass stylesheet _wordpress-gallery-magnific-popup-event-listener.scss
.
All JavaScript files should be placed in assets/javascript/custom
directory. These can also be combined as needed.