• Is it possible, to randomize the order of the images in the gallery?

    Whenever I add new images to my gallery, they all appear in the order, that I’ve added them. Some of them show the same people or locations.

    I would like to click a “Random”-button, after adding new images. So my customers would see a static gallery.

Viewing 7 replies - 1 through 7 (of 7 total)
  • hannah

    (@hannahritner)

    Hey,
    Do you mean for the Advanced Gallery block? There isn’t an option to randomize the order, sorry! I can chat with the developer about this being added to the features requests.
    Have a nice weekend!

    Best,
    Hannah

    Hello Hannah,

    yes, that would be great!

    Kind regards.

    Hey,
    Thanks for the comment. There isn’t an option for randomizing and it’s not something I can add because of the way blocks are built and the way the gallery is built.

    Gutenberg has two types of blocks, static html blocks and dynamic blocks rendered through PHP. The galleries are static which follows Gutenberg’s core standards. This means the galleries are not queried from your database based on a string of image IDs (which could be randomized each page load). Instead, they are statically added as HTML in the order you set while creating so there isn’t a point in which you can randomize the output.

    I hope that is helpful.

    Ben

    Just a note that you can move images around in your gallery manually to reorder them however you want, it doesn’t have to be in the order that you add them.
    Ben

    Hello, thanks for your answer.

    I don’t mean randomizing on each page load.
    Yes, I know I can move images around in the gallery manually. But if I have 100 images, it could take a while.
    So would it be possible to add a button into the admin area, that does exactly that? That just shuffles the images once, producing a static page?

    hannah

    (@hannahritner)

    Hey @kiblod
    Sorry, from my understanding it’s not quite that simple and I’m not sure that adding something like this would be possible.
    Let us know if there’s anything else we can help with!

    Best,
    Hannah

    I’ll put this request on my board and see if others ask for something similar.

    Thanks,

    Ben

Viewing 7 replies - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.