WordPress.org

Support

Support » Plugins and Hacks » WP-Cycle » WP-Cycle random Image

WP-Cycle random Image

Viewing 3 replies - 1 through 3 (of 3 total)
  • i mean, a random sequence of images and a unlimited number of slides!

    I was able to make it randomize the images via a small change in the wp-cycle.php file, around line 463 you’ll find this:

    ┬žjQuery(document).ready(function($) {
    $(“#<?php echo $wp_cycle_settings[‘div’]; ?>”).cycle({
    fx: ‘<?php echo $wp_cycle_settings[‘effect’]; ?>’,
    timeout: <?php echo ($wp_cycle_settings[‘delay’] * 1000); ?>,
    speed: <?php echo ($wp_cycle_settings[‘duration’] * 1000); ?>,
    pause: 1,
    fit: 1
    });
    });
    `
    before fit: 1 add random: 1,

    tautologies

    @tautologies

    or in the same file add this:

    Under:

    /*
    ///////////////////////////////////////////////
    this final section generates all the code that
    is displayed on the front-end of the WP Theme
    \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
    */

    find:

    echo '<div id="'.$wp_cycle_settings['div'].'">'.$newline;
    
    	foreach((array)$wp_cycle_images as $image => $data) {

    add: shuffle($wp_cycle_images);

    so it becomes:

    echo '<div id="'.$wp_cycle_settings['div'].'">'.$newline;
    
    	shuffle($wp_cycle_images);
    
    	foreach((array)$wp_cycle_images as $image => $data) {
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘WP-Cycle random Image’ is closed to new replies.
Skip to toolbar