Skip to content

Instantly share code, notes, and snippets.

@seafarer
Created October 15, 2013 03:15
Show Gist options
  • Select an option

  • Save seafarer/6985992 to your computer and use it in GitHub Desktop.

Select an option

Save seafarer/6985992 to your computer and use it in GitHub Desktop.
Integrate magnific popup into wordpress via http://pastebin.com/s3rT3FBr
jQuery(document).ready(function($) {
$('a[href*=".jpg"], a[href*=".jpeg"], a[href*=".png"], a[href*=".gif"]').each(function(){
//single image popup
if ($(this).parents('.gallery').length == 0) {
$(this).magnificPopup({type:'image'});
}
});
//gallery popup
$('.gallery').each(function() {
$(this).magnificPopup({
delegate: 'a',
type: 'image',
gallery: {enabled:true}
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment