Viewing 5 posts - 1 through 5 (of 5 total)
- AuthorPosts
- November 13, 2016 at 17:31 #8009
DawnParticipantI’d love to avoid a lightbox conflict on my site and would love to plug into the Magnific Popup a basic overlay for other, non-gallery/album images (such as one on my home page). Is there a way to do that?
November 14, 2016 at 01:43 #8020
RattusKeymasterAdd code below to your theme functions.php:
function add_theme_scripts() { wp_enqueue_style( 'magnific-popup' ); wp_enqueue_script( 'magnific-popup'); } add_action( 'wp_enqueue_scripts', 'add_theme_scripts' );then somewhere in your theme’s main js file add something like this:
jQuery(document).ready(function() { jQuery('a').not('.gmedia_gallery a').has('img').magnificPopup({type:'image'}); });November 14, 2016 at 02:10 #8023
DawnParticipantThank you!
What class=”” or rel=”” would I apply and to the img or a tag?November 14, 2016 at 05:13 #8026
DawnParticipantPerfect! I was able to do a gallery as well!
<script> // Magnific Popup jQuery(document).ready(function() { jQuery('a.magpop').not('.gmedia_gallery a').has('img').magnificPopup({ type:'image' }); // Magnific Popup Gallery jQuery('.maggal').each(function() { jQuery(this).find('a').magnificPopup({ type: 'image', gallery: { enabled:true, navigateByImgClick: true, tPrev: 'Previous', tNext: 'Next' } }); }); }); </script>July 22, 2017 at 21:05 #9819
DawnParticipantThis has been working great, but since one of the recent Gmedia plugin updates, I’m getting the following error:
TypeError: jQuery('a.magpop').not('.gmedia_gallery a').has('img').magnificPopup is not a function. (In 'jQuery('a.magpop').not('.gmedia_gallery a').has('img').magnificPopup({ type:'image' })', 'jQuery('a.magpop').not('.gmedia_gallery a').has('img').magnificPopup' is undefined)Any ideas?
- AuthorPosts
Viewing 5 posts - 1 through 5 (of 5 total)
- The forum ‘Gmedia Gallery WordPress Plugin’ is closed to new topics and replies.
Forum closed. Use forum at Wordpress.org: Gmedia Support
Forum
