Skip to content

Instantly share code, notes, and snippets.

@zgordon
Created February 15, 2018 11:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zgordon/09bad54144361a76c46c90f5e309edc4 to your computer and use it in GitHub Desktop.
Save zgordon/09bad54144361a76c46c90f5e309edc4 to your computer and use it in GitHub Desktop.
This is an example of how you could use fitvid and swipebox to add additional functionality to default video and gallery blocks in WordPress.
jQuery(document).ready(function(){
// Make YouTube video blocks responsive
jQuery(".wp-block-embed-youtube").fitVids();
// Add lightboxes to gallery blocks linking to media file
jQuery(".blocks-gallery-item a").swipebox();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment