' WP-Paginate ' and Custom Templates .... Help!

I had created a Custom Gallery Template, I want to only have 20 images per page. So what I wanted to do, is use the WP-Paginate.

So my question is, can I use it within a Custom Template, and if so, how?

I am open to other suggestions if I can get the same result.

Here is the code to my Custom Template:


<?php
	/*
	Template Name: Gallery Template
	*/
 ?>

<?php get_header(); ?>

	<?php if (have_posts()) : while (have_posts()) : the_post(); ?>

		<article class="post" id="post-<?php the_ID(); ?>">

			<h2><?php the_title(); ?></h2>

		</article>

        <?php endwhile; endif; ?>

<?php get_footer(); ?>

Does the template use a plug-in for the gallery itself? Because if it’s something like NextGEN Gallery, you can paginate it right from the settings menu. That would be the best way.

Other than that, have a look at this page in the Codex;
http://codex.wordpress.org/Next_and_Previous_Links

For most websites, pagination is as easy as using the template tags;

<?php previous_post(); ?>
<?php next_post(); ?>

Maybe give them a try in your code and see if it works.

That wouldn’t break off your images after twenty, but allow you to paginate between previous and next posts. If you publish twenty images in each post, you could bodge together something like what you have in mind.