Skip to content

Instantly share code, notes, and snippets.

@ericakfranz
Forked from n7studios/soliloquy-reload-click.php
Last active August 29, 2015 14:24
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 ericakfranz/674e95837428291bf47a to your computer and use it in GitHub Desktop.
Save ericakfranz/674e95837428291bf47a to your computer and use it in GitHub Desktop.
<?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