Random Gallery

Random Gallery Install Statistics

0
100%
Today: 0 Yesterday: 0 All-time: 5,586 downloads
Random Gallery Icon

Try plugin: Random Gallery

We'll create fresh WordPress site with Random Gallery installed. You have 20 minutes to test the plugin after that site we'll be deleted.

Takes ~10 seconds to install.

About Random Gallery

Random Gallery displays a different subset of your images every time your page is refreshed.

8


2


0


0


1

updated: 1 year ago
since: 9 years ago
author: David G

Description

Random Gallery lets you display a different subset of your images every time your page is refreshed. Just tell it which ones you want it to pick from and how many you want to show at a time.

The Basics

Random Gallery works with an old fashioned shortcode. You specify the pool of images with the ids or category parameter. Then you specify how many you want to show with the shownum parameter.

Here’s an example of the ids method:

[random-gallery ids='101,102,103,104,105' shownum='3']

Note there are five images in the list but only three will be shown at a time.

And here is an example of the category method:

[random-gallery category='myCategory' shownum='3']

Random Gallery can handle the ordinary Gallery shortcode parameters columns, size, and link:

[random-gallery category='myCategory' shownum='3' columns='1' size='medium' link='none']

You can put shortcodes in all kinds of blocks, but it’s best to use the shortcode widget.

ids method details

The ids parameter is the list of images you want to draw from. To build up the list, you need the numbers that WordPress assigns to each of your images.

There are plugins that let you see these numbers directly in the Media Library. Try searching the plugins directory for “reveal ids”.

Otherwise, you can find them manually:

  • open up your Media Library
  • click on a photo
  • the Attachment Details will pop up
  • the URL in your address bar will look like this: https://www.example.com/wp-admin/upload.php?item=101
  • take the number at the end of the URL (in this case 101) and add that number to ids
  • repeat this process for each photo you want to include

category method

By default, categories are not available in the Media Library. However, there are plugins that will enable them. Try searching the plugins directory for “media library categories”.

Once you have categories enabled, you can create a category, add images to it, and specify it in the shortcode by name.

Curly Quotes Issue

One tricky thing to watch out for is curly quotation marks. WordPress likes to replace straight quotes (') with curly quotes (‘). This is usually a good thing, but Random Gallery can only handle straight quotes.

The easiest and best way to make sure you’re only using straight quotes is to put your shortcode in a shortcode widget, then re-type all the quotes directly in the widget.

Thanks

I hope Random Gallery works for you. If you have any trouble, just shoot me an email. Thanks!