Displaying random images from a selected gallery
-
In NGG prior to version 2.0, it was possible to display a limited number of random images from a specific gallery — like so:
[random id="2" max="8"]
This functionality does not seem to be supported by the 2.0+ version. It is now possible to select a random set of images, but they are selected from all galleries (attributes
gallery_ids
andsource
seem to be mutually exclusive):[ngg_images source="random"]
The closest result I’ve got was this:
[ngg_images gallery_ids="1" order_by="RAND()"]
But it performs the random selection only once (after the post has been saved) and then caches it, so that the image set is not changing upon web page update. Besides, I don’t think that using SQL quantifiers in shortcodes is a good thing.
Also, I cannot find any way for limiting the number of displayed images.
So, again, the question is: how does one display a limited number of random images from a specific gallery?
- The topic ‘Displaying random images from a selected gallery’ is closed to new replies.