WordPress.org

Ready to get started?Download WordPress

Forums

Meteor Slides
[resolved] Make slideshow have a random order. (4 posts)

  1. Geet Jacobs
    Member
    Posted 3 years ago #

    Love your slideshow script!

    I wanted a random order of slides and thought I would share how to do that for anyone else here.

    To get it to display in a random order add this "'orderby' => rand" to the below query.

    meteor-slideshow.php
    code line : 9
    $loop = new WP_Query( array( 'post_type' => 'slide', 'slideshow' => $slideshow, 'posts_per_page' => $options['slideshow_quantity'],'orderby' => rand ) ); ?>

    Maybe you might consider adding this feature as default?
    Here are other order options instead of random. Maybe none could be the default? then a drop down on the options page to pick from the below?
    date
    title
    modified
    ID
    rand
    none

    Again thanks for the great plugin!

  2. Josh Leuze
    Member
    Plugin Author

    Posted 3 years ago #

    Hi, thanks for trying my plugin, glad you like it!

    You can set the slides to display randomly through a jQuery option using metadata. Check out the last two code samples in the documentation on using metadata.

    I'm trying to come up with an easy way for user to control the order of the slides aside from changing the publish date. Hopefully this would allow them to sort the slides any way they need to.

    But by all means hack away! I'd suggest making a copy of the loop file, meteor-slideshow.php, in your theme and adding a new template tag to your theme's function file to load the custom loop. This way your hacks are stored safely away and you can continue to update Meteor Slides in the future.

  3. Geet Jacobs
    Member
    Posted 3 years ago #

    Oops!

    Not sure how I missed that meta option for random..

    Reset your plugin code to the original and using meta as I should have before!

    Thank you.

  4. Josh Leuze
    Member
    Plugin Author

    Posted 3 years ago #

    No problem at all!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic