I know that there is a responsive feature for revolution-slider, but unfortunately it still loads all the mobile assets on desktop and vice versa, adding time to the page-load.
So I’d prefer to have 2 distinct sliders, one per device.
What’s the best solution for this?
It depends on how you are setting your revslider in your pages.
I think that the best way to achieve what you really want (need) is using php with conditional rules:
1) In your templates with conditional based on mobile detection. This way you will avoid loading 2 revslider at the same time.
You could use
wp_is_mobile()
conditional wordpress function for this purpose:2) In a custom shortcode with that conditional:
You will use it this way:
[my_rev alias="my_revslider_alias_slug"]
and you will need to have 2 instance of a rev slider, the first one for desktop with some alias name (home
for example) and the second one for mobile with same alias name + “_mob” (home_mob
for example).Reference:
You can also elaborate a more accurate script to detect tablets and phones, then use it as a conditional for different devices types.
This is worked for me. You need just one [short code] for normal/desktop version, _mob version will be automatically chosen.
echo do_shortcode($output); // works for me