This plugin hasn’t been tested with the latest 3 major releases of WordPress. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress.

DG Random Image


In my blog I use pages for the gallery. I have a main index Gallery that has children for each year which contain the actual gallery pages.

I wanted to display a random image from this gallery and couldn’t find a plugin to do it so I wrote my own. Usage is really simple:
The following line in your template <?php echo DG_Random_Image(array('title' => 'Gallery', 'class' =>'alignleft', 'x' => 125, 'y' => 125)); ?> or just use the widget.

title is the name of the index page, no pictures will be taken from this page, only from childpages.

class is an optional class to assign to the image

x is the width to assign to the thumbnail

y is the height to assign to the thumbnail

It will output the thumbnail for this picture with the given dimensions, linked to the page it belongs to.


Installation is easy:

  1. Upload DG_Random_Image folder and it’s contents to /wp-content/plugins/ directory
  2. Activate the plugin through the ‘Plugins’ menu in WordPress
  3. Place <?php echo DG_Random_Image(array('title' => 'Gallery', 'class' =>'alignleft', 'x' => 125, 'y' => 125)); ?> in your templates


There are no reviews for this plugin.

Contributors & Developers

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


Translate “DG Random Image” into your language.

Interested in development?

Browse the code, check out the SVN repository, or subscribe to the development log by RSS.



* Cleanup of extra folder
* Even easier to use with a widget


Initial Release