Title: Random Image
Last modified: August 18, 2016

---

# Random Image

 *  [singleton](https://wordpress.org/support/users/singleton/)
 * (@singleton)
 * [20 years, 6 months ago](https://wordpress.org/support/topic/random-image/)
 * The Jakarta script displays an image at the bottom of each post, using this code:
   
   <center><img src=”<?php bloginfo(‘stylesheet_directory’); ?>/images/hr.gif” alt
   =”The End”/></center>
 * Does anyone know of any way to display one of n images (hr1.gif, hr2.gif, hr3.
   gif, etc)
 * What that would require was taking some index number and doing a “modulo” function,
   for example if I had three different images hrmodulo(index,3).gif would get it,
   but I dont know enough about php to know how to code that. Can anyone help me?

Viewing 5 replies - 1 through 5 (of 5 total)

 *  [jwurster](https://wordpress.org/support/users/jwurster/)
 * (@jwurster)
 * [20 years, 6 months ago](https://wordpress.org/support/topic/random-image/#post-296195)
 * Look for a plugin in [http://codex.wordpress.org/plugins](http://codex.wordpress.org/plugins).
   
   There are some random image display plugins.
 *  Thread Starter [singleton](https://wordpress.org/support/users/singleton/)
 * (@singleton)
 * [20 years, 6 months ago](https://wordpress.org/support/topic/random-image/#post-296271)
 * All I saw was PhotoPress [http://isaac.wedin.org/photopress/](http://isaac.wedin.org/photopress/)
   which did a LOT more than what I wanted, and seemed to only provide one random
   graphic inserter
 * I need something that I can use more than once in a template (use one gets images
   1a, 1b, 1c and use two gets 2a, 2b, and 2c)
 * I am pretty sure the modulo approach I suggested would work, if someone can tell
   me of a tag that is numeric, and how to use php to form the name of an image 
   that will then be displayed
 *  [jwurster](https://wordpress.org/support/users/jwurster/)
 * (@jwurster)
 * [20 years, 6 months ago](https://wordpress.org/support/topic/random-image/#post-296295)
 * I have used a plugin called multiple-random-img to do what you want. I have also
   use a plugin call flashfader.
 *  Thread Starter [singleton](https://wordpress.org/support/users/singleton/)
 * (@singleton)
 * [20 years, 6 months ago](https://wordpress.org/support/topic/random-image/#post-296356)
 * flashfader seems to load a flash slideshow, and multiple-random-img seems like
   overkill, because it is designed for pulling n images from a m (n<m) database
 * I really need to find a numeric tag I can do a modulo on, and let it generate
   a number to append to a file name, as described above.
 *  Thread Starter [singleton](https://wordpress.org/support/users/singleton/)
 * (@singleton)
 * [20 years, 6 months ago](https://wordpress.org/support/topic/random-image/#post-296440)
 * I came up with my own solution:
 * <img src=”<?php bloginfo(‘stylesheet_directory’); ?>/images/rule<?=rand(1,5)?
   >.gif”>
 * randomly selects rule1.gif, rule2.gif,… rule5.gif

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Random Image’ is closed to new replies.

 * 5 replies
 * 2 participants
 * Last reply from: [singleton](https://wordpress.org/support/users/singleton/)
 * Last activity: [20 years, 6 months ago](https://wordpress.org/support/topic/random-image/#post-296440)
 * Status: not a support question

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
