Obsieger Random Image Studio

Description

Obsieger Random Image Studio displays a randomly selected image from a folder of your choice. Every page view shows a different image – perfect for header banners, teaser cards, testimonials backgrounds or “discover the region” sections.

Use it as a plain image, or turn it into a card: put a title, a short text line and a button on top of the random image, just like a cover block – but with a new background on every visit.

Features

  • Gutenberg block with live preview, folder browser and image counter.
  • Overlay cards: title, text line and button on top of the image.
  • Overlay styling: content position, text alignment, heading level, font sizes, text and button colors (including your theme palette) and adjustable darkening.
  • Whole card clickable option.
  • Cache-safe mode: the random image is picked in the visitor’s browser, so it keeps changing even with page caching plugins.
  • Aspect ratios (16:9, 3:2, 4:3, 1:1, 3:4, 2:3, 9:16) so all cards have the same shape.
  • Width, height, image fit, focal position, rounded corners, border, shadow and hover zoom.
  • Wide and full width block alignment.
  • ALT text and captions are taken from the media library when the image is part of it.
  • Option to skip the thumbnail sizes generated by WordPress.
  • Shortcode and classic widget with the same options.
  • Global default settings with live preview; every block, shortcode or widget can override them.
  • Supports JPG, JPEG, PNG, GIF, WebP, AVIF and SVG.
  • Translation ready (translations are provided through translate.wordpress.org).

Privacy

Obsieger Random Image Studio does not connect to any external service, does not use cookies and does not collect any data.

Screenshots

Blocks

This plugin provides 1 block.

  • Obsieger Random Image Studio Display a randomly selected image from a folder, optionally with title, text and button.

Installation

  1. In your WordPress dashboard go to Plugins Add New, search for “Obsieger Random Image Studio” and click Install, then Activate.
  2. Upload your images to a folder, for example wp-content/uploads/banners (via FTP or a file manager plugin). Images in the media library work too – their folders are inside wp-content/uploads.
  3. Go to Settings Obsieger Random Image Studio, choose the folder with Browse folders and adjust the default look.
  4. Add the Obsieger Random Image Studio block to a page, or use the shortcode [random_image_studio], or add the widget.

FAQ

Which folders can I use?

Any folder inside the uploads folder of your site, for example wp-content/uploads/banners (on multisite the uploads folder of the current site). Paths are relative to the WordPress installation directory. An administrator can approve additional public image folders, for example a theme image folder, under Settings Obsieger Random Image Studio Additional approved image folders. All other folders are blocked for security reasons, and symbolic links inside image folders are skipped.

How do I create a card with title and button?

In the block settings fill in Title, Text line, Button text and Button link. As soon as one of them is filled in, the overlay is shown. Choose an aspect ratio such as 2:3 so that all cards have the same height. Put several blocks into a Columns block to build a row of cards.

The image does not change when I reload the page.

Make sure Cache-safe mode is enabled (it is by default). Then the image is chosen in the browser and changes on every visit, even when a caching plugin serves the same HTML to everyone.

Which shortcode attributes are available?

[random_image_studio folder=”wp-content/uploads/colmar” aspect_ratio=”2/3″ radius=”12″ shadow=”1″ title=”Colmar” subtitle=”The heart of Alsace” button_text=”Discover” button_url=”/colmar/” button_bg=”#7b1526″ card_clickable=”1″]

All attributes: folder, width, height, aspect_ratio, fit, position, radius, border, shadow, hover_zoom, exclude_thumbnails, client_random, show_caption, alt, link, title, subtitle (or text), button_text, button_url, card_clickable, title_tag, title_size, text_size, content_position, text_align, text_color, overlay_color, overlay_opacity, button_bg, button_color.

Attributes you leave out use the default settings.

Do the old shortcodes still work?

Yes. [random_image] and the older [randomimage path="..."] still work, as long as no other plugin uses the same shortcode name.

Where does the ALT text come from?

If the image is part of the media library and has an ALT text, that text is used. Otherwise the ALT text from the block, shortcode, widget or the default settings is used.

Are my settings kept when I update?

Yes. Settings are stored in the WordPress database and are not touched by updates.

Reviews

Read all 1 review

Contributors & Developers

“Obsieger Random Image Studio” is open source software. The following people have contributed to this plugin.

Contributors

Changelog

1.6.0

  • Security: images can only be used from the uploads folder of the current site and from folders approved by an administrator.
  • Security: symbolic links inside image folders are skipped.
  • Improved: the default folder is taken from wp_get_upload_dir(), so custom uploads paths and multisite work.
  • Changed: the folder browser requires the upload_files capability.

1.5.3

  • Improved: the clickable card uses its own full-size link, so theme button styles can no longer shrink the clickable area.

1.5.2

  • Fixed: “Make the whole image clickable” works again.

1.5.1

  • Renamed to Obsieger Random Image Studio (slug obsieger-random-image-studio).
  • Improved: all output is escaped with wp_kses() and esc_attr().
  • Changed: translations are delivered through translate.wordpress.org.

1.5.0

  • New: main shortcode [random_image_studio]. [random_image] and [randomimage] keep working.
  • Improved: unique prefixes for options, scripts and hooks. Existing settings are migrated automatically.
  • Improved: media library lookup uses the WordPress query API.
  • Improved: bundled translations are used as fallback for language packs.
  • Requires WordPress 6.3 or newer.

1.4.1

  • Fix: theme palette colors (CSS variables), rgb/hsl and transparent colors are accepted for button, text and overlay colors.
  • Fix: custom button colors win over theme button styles.

1.4.0

  • New: overlay with title, text line and button on top of the random image (block, shortcode and widget).
  • New: overlay style settings (position, alignment, title element, sizes, colors, darkening).
  • New: whole image clickable option, aspect ratio, shadow and hover zoom.
  • New: cache-safe mode – the random image is chosen in the visitor’s browser.
  • New: block alignment (wide/full) and margin support.
  • New: German translations.
  • Fix: block now inherits the global default settings.
  • Fix: shortcode and widget support all display options.
  • Fix: stricter folder path check and correct paths on Windows servers.

1.3.0

  • Redesigned settings page with live preview.

1.2.0

  • Folder browser, image count, random editor preview, image position, rounded corners and border.

1.1.0

  • Width and height presets, thumbnail exclusion in the block.

1.0.0

  • Initial release.