Add A Back To Page Link For NextGEN Gallery Created Pages

Share Your Thoughts

If you like using the NextGEN gallery plugin on your WordPress site, you may have discovered that it can be used to build new gallery pages for you. Here’s how to link back to a main gallery page.

After you create a new gallery and upload your images, if you hop over to the Manage Gallery page, you can let the plugin help you to create a new page. The Add page button is at the top of of the thumbnail list, on the gallery settings panel.

I like to have a main Gallery page with thumbnails that link through to the individual gallery pages, but it’s nice to have a link back on each page to the main Gallery. I found that by using a little bit of jQuery, it is easy to do this. Just make sure you have included the jQuery library link in your header.php file, then create your own .js file and add that to the header.php too. Add the script below, modifying the link to suit your needs, to your .js file and voila!

jQuery(document).ready(function(){

// add link back to galleries page
jQuery(‘<p><a ┬áhref=”http://yourwebsiteurl.com/page-directory/photo-galleries/”>Back to Galleries</a></p>).insertBefore(‘div.slideshowlink’;);

});

This technique can be used to insert content to your pages, either before or after targeted elements. You can also add or remove content using jQuery. That’s the subject for another post though…

jQuery , , , ,


What do you think?

It's good to talk!

Your email address will not be published. Required fields are marked *

Please answer before submitting form * Time limit is exhausted. Please reload CAPTCHA.