Last active
August 29, 2015 14:16
-
-
Save eri-trabiccolo/c8060c93226c4b4cdf04 to your computer and use it in GitHub Desktop.
different slider on mobile + centering slider feature disabled
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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