
NextGEN Gallery slideshow with Navigation
NOTE: This post was written nearly 6 years ago initially. I donāt implement this particular solution any longer, but Iām leaving it up in case it points somebody in a useful direction in the futureā¦
Iām using the free version of the WordPress NextGEN gallery, which by the way, is a pretty great plugin. Ā I wanted to use the slideshow, but wanted to have navigation attached to it. Ā The slideshow in the free version of NextGEN gallery doesnāt have the navigation. Ā I particularly like the navigation used in the Superslides jquery plugin. Ā So for what itās worth, hereās what I didā¦
In the plugin file structure, thereās a folder for the modules, the types of āproductsā that NextGEN has. Ā Within the nextgen_basic_gallery folder, thereās a templates folder, and there is a slideshow folder in that folder. Ā This holds the code for the basic slideshow that comes with NextGEN.
Ignoring the āflash outputā section, move to the next section of code, commented with āDisplay JQuery Cycle Slideshowā. Ā In this section, there is a āforā loop. Ā This loop is cycling through the images, and writing something for each one. Ā I changed that to only spit out the <img> tag information, since the Superslides.js plugin doesnāt need any more than that regarding images. Ā I also surrounded the āforā loop with the <div id=āslidesā>[for loop]</div> that Superslides needs.
Additionally I added a div with some style attached to it, and wrapped it around the āslidesā div, so that I could use the Superslide inherit_width_from and āinherit_height_fromā parameters to constrain the size and location of the slideshow.
After the loop is done, I just tossed in the navigation using āFont Awesomeā. Ā Be sure to include Font Awesome in your master styles.
<nav class="slides-navigation">
<a href="#" class="next"><i class="fa fa-chevron-right"></i></a>
<a href="#" class="prev"><i class="fa fa-chevron-left"></i></a>
</nav>
Next, I tossed in the required Superslides code to make the whole thing workā¦
<script src="path/to/wp-includes/js/superslides/jquery.easing.1.3.js"></script> <script src="path/to/wp-includes/js/superslides/jquery.animate-enhanced.min.js"></script> <script src="path/to/wp-includes/js/superslides/jquery.superslides.js" type="text/javascript" charset="utf-8"></script>
<script> jQuery(function() { jQuery('#slides').superslides({ inherit_width_from: '.someslideeshow', inherit_height_from: '.someslideeshow', hashchange: true, play: 5000 });
jQuery('#slides').on('mouseenter', function() { jQuery(this).superslides('stop'); console.log('Stopped') }); jQuery('#slides').on('mouseleave', function() { jQuery(this).superslides('start'); console.log('Started') }); }); </script>
The result is a navigable, paginated slideshow, utilizing NextGENās awesome gallery plugin, but styled with the Superslides navigation that I like.
When NextGEN updates, Iāll need to fix the plugin again, but the work is minimal, as long as youāre comfortable writing minimum PHP and Javascript. Ā I could probably extend the plugin to take advantage of this new ātemplateā, but I really canāt be bothered to do that at this time. Ā Iām happy with what I needed to accomplish. Ā Maybe Iāll do that in the future, to help future-proof the slideshow, and make it available as a NextGEN template for others to use. Ā Weāll see what kind of time I have, or if itās worth it to anybody else.
I hope this helps somebody else out there who has the same question I did.