NextGen Gallery for WordPress – Random order Jquery slideshow

I’ve used NextGen gallery for WordPress quite a bit and it’s a nice plugin. BUT… I’ve always wanted to be able to do ‘easy embed’ multiple jquery slideshows that show images in a RANDOM order. (This IS possible using the Flash slideshow component but I don’t always want/need to use Flash for this).
The non-Flash (jQuery) slideshow component is currently quite basic, and after much hunting around it was looking like this simple requirement would be difficult to implement.

I have, however, found a simple hack for this. It does involve editing one of the plugin JS files though, which isn’t ideal (e.g. future plugin upgrades may well overwrite this change). But this instruction might help someone out – and might persuade someone more technical to extend the core plugin in some way.

Firstly, set up your working slideshow (I use the [ slideshow id=x width=a height=b ] shortcode to embed it in a page or post).
Next, to make this slideshow random edit the nextgen-gallery/js/ngg.slideshow.min.js file (from dashboard plugins>editor and find this JS file)
Find this snippet “cycle({fx:s.fx,containerResize:1,fit:1,” and immediately after this add
where x is the number of slides in your gallery

1) this will affect ALL slideshows in your site i.e. will make them all random
2) it’s not truly random, it follows the usual slide order, just randomises the *starting slide* (then wraps around at the end).
3) if you have multiple slideshows of multiple galleries in your site the value of x might become a problem as it’s a hardcoded global variable. Best option here would be to keep x the same as the number of slides in the smallest gallery.
4) in the same JS file i also changed “jQuery(obj+’ img:first’).fadeIn(1000,” to “jQuery(obj+’ img:first’).fadeIn(0,” to stop the slide 1 in the gallery showing up on page load. This *might* cause an issue on slow connections?

If anyone can improve this please do!
I would LOVE it if i could simply do something like [ slideshow id=x random=true ]

One response to “NextGen Gallery for WordPress – Random order Jquery slideshow”

  1. chrisd says:

    hmmm… not sure this actually works any more – can’t figure out what’s changed!

    use this instead?

Leave a reply


    Latest news

    Simon Lees Photography – new website

    We were asked to design and produce a new website for Bath-based photographer Simon Lees. Using the WordPress ...continued

    Telly Voices – A New London Voice Artist Agency

    tallhatDesign was commissioned to design and produce a website for this new Voice Artist Agency. A database driven ...continued

    A few new launches

    This is long overdue, and I still need to update the portfolio, but recent site launches for tallhatDesign ...continued


    Our customers say...

    “…from the moment we met up to discuss what I wanted, to the finished article, I was nothing other than extremely impressed. Every deadline was hit; every promise kept and every part of the professional and detailed process exceeded expectation. ...continued

    “tallhatDesign have been excellent to work with, creating a website that we are very proud of. Thank you Tallhat for making a very difficult task painfree and enjoyable. Look forward to working with you again.” • ...continued

    • Read more of our feedback...

Highslide for Wordpress Plugin