Hi folks, I’d like to have the FullWidth Easy Slider of my homepage showing images in random order.
I’ve found in the forum a solution for the Masonry gallery component:
https://kriesi.at/support/topic/masonry-gallery-how-to-sort-by-random/
How can I adapt this solution for the FullWidht Easy Slider component? Does this component have a similar function to be “adjusted”?
Thanks in advance!
Hey Angelo,
Thank you for the inquiry.
You can use this filter in the functions.php file to shuffle the slider items in random order.
function avf_shuffle_assoc($my_array)
{
$keys = array_keys($my_array);
shuffle($keys);
foreach($keys as $key) {
$new[$key] = $my_array[$key];
}
$my_array = $new;
return $my_array;
}
add_filter('avf_avia_builder_slideshow_filter', function($data, $class) {
$data['id_array'] = avf_shuffle_assoc($data['id_array']);
return $data;
}, 10, 2);
Make sure to purge the cache before testing the page.
Best regards,
Ismael
Thanks Ismael, it works GREAT! This should be an option of this component for the future release! Please ask the developers :-)
Thanks pal, excellent help!
Bye,
A.-