Skip to content

Instantly share code, notes, and snippets.

@n7studios
Created June 5, 2015 13:53
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save n7studios/b1069870bf1c7b89fb97 to your computer and use it in GitHub Desktop.
Save n7studios/b1069870bf1c7b89fb97 to your computer and use it in GitHub Desktop.
Soliloquy - Reload Soliloquy on Click
<?php
/**
* Plugin Name: Soliloquy - Reload Soliloquy on Click
* Plugin URI: http://soliloquywp.com
* Version: 1.0
* Author: Tim Carr
* Author URI: http://www.n7studios.co.uk
* Description: Registers a click handler to reload Soliloquy layouts. Useful when a Soliloquy slider isn't visible on page load.
*/
function soliloquy_reload( $data ) {
?>
jQuery('.su-tabs-nav > span').on('click', function(e) {
setTimeout(function(){
soliloquy_slider['<?php echo $data['id']; ?>'].reloadSlider();
}, 100);
});
<?php
}
add_action( 'soliloquy_api_end_global', 'soliloquy_reload' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment