WordPress.org

Ready to get started?Download WordPress

Forums

WP-Cycle
WP-Cycle random Image (4 posts)

  1. mboratto@gmail.com
    Member
    Posted 3 years ago #

    Hello, is there a way to define random images sequence for the banner?

    http://wordpress.org/extend/plugins/wp-cycle/

  2. mboratto@gmail.com
    Member
    Posted 3 years ago #

    i mean, a random sequence of images and a unlimited number of slides!

  3. G Morty Ortega
    Member
    Posted 3 years ago #

    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,

  4. tautologies
    Member
    Posted 2 years ago #

    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) {

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags