Hi Support,
My WP require to load one slider for desktop/ notebook; and another one for mobile only.
Refer to below script, I found the script that may able to load slider by condition.
1) It is still valid to apply in WP ? Or can you please share me the best way to handle my request.
2) Where to put in the script in back-end system ?
Sample script:
if( !function_exists(‘rev_slider_detection’) ) {
function rev_slider_detection( $atts ) {
extract(shortcode_atts(array(
‘alias’ => ” // the alias name of your desktop rev-slider
), $atts));
$output = ‘[rev_slider alias=”‘;
if ( !wp_is_mobile() ) {
// For desktop only
$output .= $alias . ‘”]’;
} else {
// For mobile only
$output .= $alias . ‘_mob”]’;
}
return $output;
// or (because untested)
// return do_shortcode(‘” . $output . “‘);
}
add_shortcode(‘my_rev’, ‘rev_slider_detection’);
}