Skip to content

Instantly share code, notes, and snippets.

@eri-trabiccolo
Last active August 29, 2015 14:16
Show Gist options
  • Save eri-trabiccolo/c8060c93226c4b4cdf04 to your computer and use it in GitHub Desktop.
Save eri-trabiccolo/c8060c93226c4b4cdf04 to your computer and use it in GitHub Desktop.
different slider on mobile + centering slider feature disabled
add_action('template_redirect', 'mobile_slider');
function mobile_slider(){
if ( ! ( tc__f('__is_home') && wp_is_mobile() ) )
return;
// remove the following filter if you wanna keep the slider centering feature
add_filter('tc_customizr_script_params', 'no_center_slides');
function no_center_slides($params){
$params['centerSliderImg'] = 0;
return $params;
}
add_filter('tc_slider_name_id', 'my_mobile_slider');
function my_mobile_slider($slider_name_id){
$my_mobile_slider = 'mobile_slider'; //set name of your home slider in mobiles
return $my_mobile_slider;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment