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

    A few new launches

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


    New year, New office

    Happy New Year for 2014! The new year is a fresh start with a change of office. tallhatDesign ...continued


    Beware of 123-reg and their auto-renewal tactics

    Many years ago I registered 3 domains for a client with 123-reg.co.uk. About 18 months ago the client ...continued


     

    Our customers say...

    “Thank you for all your creativity and input with the website and literature – the cards and website have already been drawing many compliments. I won’t hesitate to recommend your services. I’m absolutely thrilled with the ‘look and feel’ – you ...continued


    “Chris [Dawson, Creative Director] has an amazing ability to create attractive graphical sense on the page. The usability and visual integrity of our site has increased 1000% since he has worked with us on it. I would be happy to ...continued


    • Read more of our feedback...

 
 
Highslide for Wordpress Plugin