Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter mboratto@gmail.com

    (@mborattogmailcom)

    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,

    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.