Hey,
1. Download the Javascript file from: https://gist.github.com/IsmailM/0d4a51a49473649ce7400c8d43e8f85e. This file includes Swipebox – If you have selected Colorbox (in the settings), you will need to add the Javascript file for colour box as well..
2. Next place this Javascript file into your theme folder. Ensure the file is names: ‘Flickr-justified-gallery.js’
3. Next you simply need to enqueue the javascript file. This is the difficult bit.
Firstly, look for a function that includes a line starting with wp_enqueue_script(‘…’);
. e.g. I had a function as follows:
function add_javascript() {
wp_enqueue_script( ‘...');
}
If you find such function simply add the following line under it.
wp_enqueue_script( 'justified_grid', get_template_directory_uri() . '/Flickr-justified-gallery.js');
So you have something as follows.
function add_javascript() {
wp_enqueue_script( ‘...’);
wp_enqueue_script( 'justified_grid', get_template_directory_uri() . '/Flickr-justified-gallery.js');
}
IF you cannot find such a function, you need to create your own function and call the function…
function add_javascript() {
wp_enqueue_script( 'justified_grid', get_template_directory_uri() . '/Flickr-justified-gallery.js');
}
add_action( 'wp_enqueue_scripts', 'add_javascript' );
Let me know if you need any further help