Using the NextGen Gallery with any jQuery Gallery Plugin

So I don’t love to develop with Wordpress all that much (much prefer python to php any day), but it has it’s place, and can definitely serve a purpose.  One of the things that I run into quite often is having to add some sort of photo gallery to the Wordpress installation.  I looked around for a simple administration type gallery that would just supply me the images and text without having a lot of extra unnecessary hoopla that most Wordpress plugins and galleries have.  That said, the environment for this is lacking so I chose to use Alex Rabe’s NextGen Gallery.

At first the gallery was a bit much for me and I searched for something more lightweight to no avail.  That said I found a quite simple and elegant solution so that I can pretty much use any jQuery Gallery Plugin with the NextGen Gallery thanks to NextGen’s templating capabilities.

In this example I will use the Gallerific plugin to display the gallery, completely bypassing any of the NextGen built in Gallery support.

  • Start by downloading the Gallerific plugin and installing it into your wordpress theme (see wp_enqueue_script if you don’t know how to do that), once you are sure it is in your header accordingly move to the next step
  • Install the NextGen Gallery Wordpress Plugin - this step is pretty straightforward, and once it is installed, go ahead and create a gallery and put a few images in it.
  • The next step is to create the custom template for to hold your images and output them with the Gallerific script, this is done by creating a directory in your theme named wp-content/themes/your-theme/nggallery/gallery-yourtemplatename.php Here you name the part after gallery- with the name of the template that you will address in your shortcode to output on your post or page (or programmatically).
  • Now that this is done, you need to put some code in your new custom template to make this work.  Fortunately you will be given all the images in your respective gallery, so it is quite easy to display them in the template, here I’m not displaying thumbnails at all in the gallery, just numbered pagination:

Viewing 10 Comments

close Reblog this comment
blog comments powered by Disqus