Skip to content

Instantly share code, notes, and snippets.

@amdrew
Last active December 19, 2015 10:48
Show Gist options
  • Save amdrew/5942619 to your computer and use it in GitHub Desktop.
Save amdrew/5942619 to your computer and use it in GitHub Desktop.
Load the required scripts for Colorbox into the Easy Image Gallery plugin http://wordpress.org/plugins/easy-image-gallery/
<?php
function my_theme_easy_image_gallery_scripts() {
$lightbox = function_exists( 'easy_image_gallery_get_lightbox' ) ? easy_image_gallery_get_lightbox() : '';
if ( 'colorbox' == $lightbox ) {
wp_enqueue_script( 'colorbox-js', get_stylesheet_directory_uri() . '/colorbox/jquery.colorbox-min.js', array( 'jquery' ), '1.4.26', true );
wp_enqueue_style( 'colorbox-css', get_stylesheet_directory_uri() . '/colorbox/colorbox.css', '', '1.4.26', 'screen' );
}
}
add_action( 'easy_image_gallery_scripts', 'my_theme_easy_image_gallery_scripts' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment