• Resolved user454r5ez

    (@user454r5ez)


    Hello,

    I’m using FooGallery and I would like to know if it’s possible to load images randomly from multiple galleries using a single block or a single shortcode.

    More specifically, is there a way to:

    1. Display random images pulled from all existing galleries, or
    2. Display random images from a specific list of gallery IDs defined in one block or shortcode (for example: galleries 3, 5, and 12)?

    My goal is to avoid creating a separate gallery just for this purpose and instead dynamically fetch random images from selected galleries.

    Is this already supported by FooGallery (via an option, filter, or shortcode parameter), or would this require custom development?

    Thank you very much for your help and for your great plugin!

Viewing 1 replies (of 1 total)
  • Plugin Author bradvin

    (@bradvin)

    hi @user454r5ez,

    I think these features might help you:

    • Dynamic galleries – you can create a gallery without saving it, just by supplying the list of attachments you want. eg. [foogallery attachment_ids=”45,46,49″]
    • Random sort order – you can tell a gallery to sort randomly eg. [attachment_ids=”45,46,49″ sort=”rand”]. Just bear in mind that your website cache might make this not random if your page output is cached.
    • Limit items in a gallery – you can limit how many items are shown eg. [attachment_ids=”45,46,47,48,49,50″ sort=”rand” limit=”2″]

    So using all those, you could show a gallery of 2 random images based off a list of 6 images.

    You can also supply the gallery id, which will then use all the settings for that gallery.

    There is no feature to populate from another gallery, or list of galleries, but you could quite easily extend foogallery to do this using all the hooks and filters.

    Check out the docs on the shortcode attributes, which might help : https://fooplugins.com/documentation/foogallery/troubleshooting-foogallery/shortcode-attributes/

    • This reply was modified 2 months ago by bradvin.
Viewing 1 replies (of 1 total)

You must be logged in to reply to this topic.