Show an image gallery from NextGEN in a WordPress template

July 24, 2009 1:40 am
Published by
Leave your thoughts

NextGEN gallery is an absolute staple amongst the WordPress plugins I use and is often the first plugin I add after a fresh install. Together with the addition of JonDesigns smooth gallery plugin you’ve got all you need to display images, slideshows and galleries on your posts and pages with a whole range of different options. However what if you want to display an image gallery straight from your WordPress theme using PHP? For example if you want to hard-wire a gallery to appear in a sidebar or footer? I often create custom themes and like to incorporate galleries right into the template without the use of shortcodes. In that case this little snippet of code should sort you out:
<?php echo nggShowGallery(gallery ID,null) ?>
Simply copy and paste it into your wordpress theme where you want the gallery to appear and replace ‘gallery ID’ with the ID of the gallery that you would like to display. Tags: ,

Categorised in: ,

This post was written by WillyNilly

Leave a Reply

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