Title: [Plugin: WP-Cycle] Random Function
Last modified: August 19, 2016

---

# [Plugin: WP-Cycle] Random Function

 *  [greencode](https://wordpress.org/support/users/greencode/)
 * (@greencode)
 * [16 years, 4 months ago](https://wordpress.org/support/topic/plugin-wp-cycle-random-function/)
 * The plugin’s great but I think it would really benefit from having a Random function.
   Is there any way that I can quickly add this to the wp-cycle.php page? I notice
   the word “random” appears in the jquery.cycle.all.min.js file so I’m presuming
   it’d be fairly straight-forward to add?
 * [http://wordpress.org/extend/plugins/wp-cycle/](http://wordpress.org/extend/plugins/wp-cycle/)

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

 *  [trix3x](https://wordpress.org/support/users/trix3x/)
 * (@trix3x)
 * [16 years, 2 months ago](https://wordpress.org/support/topic/plugin-wp-cycle-random-function/#post-1276260)
 * Hi, I solved it by the shuffle php function.
    I put the shuffle($wp_cycle_images);
   on line 407 in wp-cycle.php before the foreach function begins:
 *     ```
       406	echo '<div id="'.$wp_cycle_settings['div'].'">'.$newline;
       407	shuffle($wp_cycle_images);
       408	foreach((array)$wp_cycle_images as $image => $data) {
       409...
       ```
   
 * That will randomize the order of the images in the html file… give it a try.
   
   It works for me.
 *  Thread Starter [greencode](https://wordpress.org/support/users/greencode/)
 * (@greencode)
 * [16 years, 1 month ago](https://wordpress.org/support/topic/plugin-wp-cycle-random-function/#post-1276266)
 * Sorry for taking so long to get back (I wish there was some kind of notification
   system on WordPress Support!). I’ll give this a try next week, when I’m back 
   in the office, and let you know how I get on.
 *  Thread Starter [greencode](https://wordpress.org/support/users/greencode/)
 * (@greencode)
 * [16 years, 1 month ago](https://wordpress.org/support/topic/plugin-wp-cycle-random-function/#post-1276267)
 * Hi tric3x. Finally got around to implementing this today and it works perfectly–
   really great addition to an already simple and great plugin. Thanks.
 *  [marknesss](https://wordpress.org/support/users/marknesss/)
 * (@marknesss)
 * [15 years, 11 months ago](https://wordpress.org/support/topic/plugin-wp-cycle-random-function/#post-1276279)
 * Upon adding the shuffle function, I lost my ability to delete slides. Any one
   else experiencing this?
 *  [lindebjerg](https://wordpress.org/support/users/lindebjerg/)
 * (@lindebjerg)
 * [15 years, 7 months ago](https://wordpress.org/support/topic/plugin-wp-cycle-random-function/#post-1276309)
 * Super adon, just what I was looking for:-) and I can still delete slides.
 *  [Asdrubal](https://wordpress.org/support/users/namaguideras/)
 * (@namaguideras)
 * [15 years, 6 months ago](https://wordpress.org/support/topic/plugin-wp-cycle-random-function/#post-1276314)
 * Thanks trix3x! I imagined this and you are here with the solution! XD

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

The topic ‘[Plugin: WP-Cycle] Random Function’ is closed to new replies.

 * 6 replies
 * 5 participants
 * Last reply from: [Asdrubal](https://wordpress.org/support/users/namaguideras/)
 * Last activity: [15 years, 6 months ago](https://wordpress.org/support/topic/plugin-wp-cycle-random-function/#post-1276314)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
