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
“startingSlide:Math.floor(Math.random()*x),”
where x is the number of slides in your gallery

NOTES/CAVEATS:
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? http://wordpress.org/extend/plugins/jj-nextgen-jquery-cycle/

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...

    “We have worked with Tallhat Design on the development of both our Company websites, and through all its processes Tallhat’s involvement has been incredibly professional and supportive. Most importantly, what we wanted is what we got – Tallhat took on ...continued


    “The website is working wonders! It is amazing how business has increased since it went live, it is really clear to see how people are finding it through google searches. Thank you so much.” • www.bathcakecompany.co.uk ...continued


    • Read more of our feedback...

 
 
Highslide for Wordpress Plugin