Theme template file for displaying NextGen gallery

I need to show a lot of different galleries each on its own page but don’t want to create an individual page for each gallery

Is there a way of passing the gallery id into a template and having php display that gallery.

What I have done below works with the first gallery page but clicking on the buttons for other pages now doesn’t work.

I created a theme template file and assign that template to page “test” and pass to it the gallery_id in a call like this

The page called test is just set to be the Gallery Display Template
and then I used php to call the Nextgen gallery in the template file as below:

<?php /* Template Name: Gallery Display Template */ ?>
<?php
/*
* Template Post Type: post, page
*/
$galleryid = $_GET[‘galleryid’];
get_header();
?>
<!– wp:imagely/nextgen-gallery –>
<?php
echo do_shortcode(‘[ngg src=”galleries” ids=”‘.$galleryid.’” display=”basic_thumbnail” thumbnail_crop=”0″]’);
?>
<!– /wp:imagely/nextgen-gallery –>

<?php
get_footer();
?>`

Thanks in advance for any pointers on getting something like this working
Neil

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer