Home Forums WoodMart support forum Slider Revolution: Load one slider for desktop & notebook; one for mobile.

Slider Revolution: Load one slider for desktop & notebook; one for mobile.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #324800

    tsamis
    Participant

    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’);
    }

    #324853

    Artem Temos
    Keymaster

    Hello,

    This code seems to be correct and you can put it to your child theme in the functions.php file. But note that we don’t provide support for any third-party customizations like that. So we can’t guarantee that it will work as you expected.

    Kind Regards

Viewing 2 posts - 1 through 2 (of 2 total)