Title: Better random folder image
Last modified: February 6, 2021

---

# Better random folder image

 *  [yfchild](https://wordpress.org/support/users/yfchild/)
 * (@yfchild)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/better-random-folder-image/)
 * Hi,
 * Great plugin/help plugin but where i can change in code function rand to have
   better random images in the same post.
    I create 6 folders with xxx images but
   sometimes i have the same images.
 * Can you help me, i need so much don´t have same images in same post, or have 
   most variery images in 500 posts about.
 * i see this post:
    [https://stackoverflow.com/questions/5612656/generating-unique-random-numbers-within-a-range](https://stackoverflow.com/questions/5612656/generating-unique-random-numbers-within-a-range)
 * the last response… seem interesting

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

 *  Plugin Author [Hot Themes](https://wordpress.org/support/users/hotwptemplates/)
 * (@hotwptemplates)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/better-random-folder-image/#post-14011743)
 * Hi,
 * Unfortunately, this plugin currently allows you to pick only one folder and the
   subfolders are disregarded.
 * Thanks,
    Milos
 *  Thread Starter [yfchild](https://wordpress.org/support/users/yfchild/)
 * (@yfchild)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/better-random-folder-image/#post-14015374)
 * Hi thanks to answer, I´m not have problem with the folders, for that I found 
   a soluce, no problem with that.
 * But i need know if you can help me, give a tips for :
 * Have better random image in same posts if i put 2/3 shortcodes to prevent see
   the same image from a post (avoid duplicate image).
 * Although I have folders with 50 different images, if i put 2/3/4 shortcodes i
   see the same image 1/2 time. is it impossible to improve random function to avoid
   this?
 *  Thread Starter [yfchild](https://wordpress.org/support/users/yfchild/)
 * (@yfchild)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/better-random-folder-image/#post-14021399)
 * Posible?
 *  Plugin Author [Hot Themes](https://wordpress.org/support/users/hotwptemplates/)
 * (@hotwptemplates)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/better-random-folder-image/#post-14023453)
 * Hello,
 * It’s probably possible but requires a lot of coding. This plugin uses random()
   function. It randomly selects one image each time (out of 3, 10, 1000, etc.).
   So, if you have just 3 images in a folder, it’s quite possible it will display
   the same image twice (33% chance).
 * Thanks,
    Milos
 *  Thread Starter [yfchild](https://wordpress.org/support/users/yfchild/)
 * (@yfchild)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/better-random-folder-image/#post-14027212)
 * where the line to change that, i will try thanks
 *  Plugin Author [Hot Themes](https://wordpress.org/support/users/hotwptemplates/)
 * (@hotwptemplates)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/better-random-folder-image/#post-14028975)
 * Hello,
 * Random function is used in this line (3 occurrences):
 * `$ind = rand(1,count($images)) ;`
 * in file hot_random_image.php
 * Thanks,
    Milos
 *  Thread Starter [yfchild](https://wordpress.org/support/users/yfchild/)
 * (@yfchild)
 * [5 years, 3 months ago](https://wordpress.org/support/topic/better-random-folder-image/#post-14044569)
 * Thanks a lot I will try to modify it for new project.

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

The topic ‘Better random folder image’ is closed to new replies.

 * ![](https://ps.w.org/hot-random-image/assets/icon-256x256.jpg?rev=1826049)
 * [Hot Random Image](https://wordpress.org/plugins/hot-random-image/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/hot-random-image/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/hot-random-image/)
 * [Active Topics](https://wordpress.org/support/plugin/hot-random-image/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/hot-random-image/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/hot-random-image/reviews/)

 * 7 replies
 * 2 participants
 * Last reply from: [yfchild](https://wordpress.org/support/users/yfchild/)
 * Last activity: [5 years, 3 months ago](https://wordpress.org/support/topic/better-random-folder-image/#post-14044569)
 * Status: not resolved