Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1404074

    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!

    #1404090

    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

    #1404122

    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.-

    #1404178

    Hi,

    Great! Glad to know that the filter is working. Please feel free to open another thread if you have more questions.

    Have a nice day.

    Best regards,
    Ismael

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Random order for the images in the FullWidth Easy Slider?’ is closed to new replies.