Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save eri-trabiccolo/ef50422dc6c513d011c8 to your computer and use it in GitHub Desktop.
Save eri-trabiccolo/ef50422dc6c513d011c8 to your computer and use it in GitHub Desktop.
Display the same slider everywhere
add_filter( 'tc_show_slider' , '__return_true' );
add_filter( 'tc_slider_active_status' , '__return_true' );
//display in full width ?
add_filter( 'tc_slider_layout' , '__return_true' );
//force the slider name to the front page slider name
add_filter( 'tc_slider_name_id', 'force_slider_name');
function force_slider_name() {
return method_exists('TC_utils', 'tc_opt') ? TC_utils::$inst->tc_opt( 'tc_front_slider' ) : '';
}
// force js params to the front page slider options
add_filter( 'tc_customizr_script_params', 'my_slider_params');
function my_slider_params( $_params){
$slider_name = force_slider_name();
if ( $slider_name ){
$_params['SliderName'] = $slider_name;
$_params['SliderDelay'] = TC_utils::$inst->tc_opt('tc_slider_delay');
$_params['centerSliderImg'] = esc_attr( TC_utils::$inst->tc_opt( 'tc_center_slider_img') );
}
return $_params;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment