I fight with exactly the same problem. I also pasted the posted code …
function custom_rl_lightbox_args($args) {
if (wp_is_mobile() === true) {
$args['script'] = 'swipebox'; // swipebox, nivo, prettyphoto, fancybox
} else {
$args['nivo'] = 'swipebox'; // swipebox, nivo, prettyphoto, fancybox
return $args;
}
add_filter('rl_lightbox_args', 'custom_rl_lightbox_args');
… in my function.php, but nothing changed. It doesn’t work.
Unfortunately I’m not firm with php. Would anybody please explain step-by-step what I have to do using the solution with Mobile Detect class http://mobiledetect.net/ ?