Support » Plugins » Portfolio Slideshow Random Order

  • First, thanks for this brilliant plugin; I’ve been experimenting with WordPress for a few months, and other slideshow plugins just didn’t deliver (I’d resorted to using the external ‘PHPSlideShow’ in an iframe).
    However, I have a query/feature request: is it possible to make the slides show in a random order? If so, how, please?
    (I can write xhtml and css, and tinker with php, but otherwise I’m a very simple soul!)

Viewing 13 replies - 1 through 13 (of 13 total)
  • Hi there,
    That feature shouldn’t be too hard to add – I’ll give it some thought and it will probably show up soon.

    If you wanted to change the code of the plugin yourself, you could go in and modify the query parameters. Basically, look for anywhere you see

    'order' => 'ASC'

    and change it to

    order' => 'RAND'

    Cheers,
    Dalton

    Thread Starter itproxy

    (@itproxy)

    Hi Dalton,
    Thanks for responding. However, I can’t get it to work; whatever I do to the .php file (changing ‘order’, and/or ‘order by’) it’s either ascending or descending order, never random.
    I just don’t understand php well enough to sort this out; perhaps I’m missing the point entirely.
    I could pseudo-randomise PHPSlideShow by simply renaming files from time to time; that is a harder option if files are given a database ID.

    Hmm, not sure why that wouldn’t work… I will have to look into it. There may be some way to add a shuffle function in there somewhere.

    In the near term you can also just re-order the images by drag and drop in the media uploader. It’s not quite a random shuffle, but at least it’s a quick and dirty way to switch up the order of the images.

    Thread Starter itproxy

    (@itproxy)

    Thanks, Dalton, I hadn’t realised I could ‘freshen up’ the order of appearance in that way, which, since it’s very easy to do, goes a long way to meeting my main concern (though random would be nice!).

    A quick and dirty solution is to add ‘random: 1’ (two times) in the portfolio_slideshow.php file

    $(this).cycle({
    	fx: \''. $ps_trans . '\',
    	speed: '. $ps_speed . ',
    	timeout: '. $timeout . ',
    	random: 1,

    The slideshow will be in a random order.

    Thread Starter itproxy

    (@itproxy)

    Brilliant! Thanks. I now have my site set up in the way I originally wanted it to appear, without any workarounds. No longer have any excuse for not updating the content!

    Thread Starter itproxy

    (@itproxy)

    I’ve been tearing my hair out trying to eliminate another niggle; I don’t like the way the images acquire a border when the mouse is hovered over them, causing the image to ‘twitch’ (move sideways and down).
    Can’t seem to sort this, whatever I try in the CSS file (plugin or theme).
    Am I looking in the wrong place? What do I need to do to stop this effect, please?
    With thanks.

    That would definitely be in your theme’s CSS somewhere, it’s not in the plugin. Try adding something like

    a img {
    border: none;
    }

    To the bottom of your style.css and see if that does the trick.

    Dalton

    Thread Starter itproxy

    (@itproxy)

    Thanks, Dalton.
    Finally cracked it: had to put #page img {border: none;} in the theme css to sort it. For reasons I don’t understand, had been able to stop the border displaying when not mouseover by simply using .home img {border: none;}, but this didn’t work on mouseover.
    I suspect I haven’t really got my head round the ‘cascading’ part of CSS!

    Anco’s solution for a random slideshow does work, but he has cited the wrong file for editing. Look for this in the portfolio-slideshow.js file. Mine looked like this, after adding the random line:

    $('#portfolio-slideshow'+num).cycle({
    					fx: psTrans[num -1],
    					speed: psSpeed[num -1],
    					timeout: psTimeout[num -1],
                                            random: 1,

    Yup, the javascript was all moved to an external file in Portfolio Slideshow 1.0, so scoly’s method is the correct way to do it now.

    I’ll get this into the plugin at some point.

    Dalton

    Well at first I wasn’t able to get this working, then found a cache issue on my side of things. The random: 1 works as part of the cycle plugin functionality with jquery. All good here!

    Thank you so much Dalton for a great plug-in and wonderful support. And kudos to scoly for your helpful post!

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘Portfolio Slideshow Random Order’ is closed to new replies.