I've been working on a wordpress site, and I'm trying to build a page where visitors can see all of the images that have been uploaded to the wordpress media gallery, regardless of whether or not said images are attached to any particular posts. The images from the query are showing up, but the pagination links are not. I can view the paginated pages by including page/2/ or page/3/ at the end of my URL, but the pagination links to bring viewers to those pages aren't showing up at all.
The gallery is located at http://www.nickpassaro.com/clientsitedev/NJRI/gallery/ The images on http://www.nickpassaro.com/clientsitedev/NJRI/gallery/page/2/ and http://www.nickpassaro.com/clientsitedev/NJRI/gallery/page/3/ are not the same images as the images on http://www.nickpassaro.com/clientsitedev/NJRI/gallery/ so I assume pagination is possible here.
The code for the gallery template is as follows:
<?php
/*
Template Name: Gallery
*/
get_header(); ?>
<div class="main" role="main">
<div class="standard-section">
<div class="gallery">
<h1 class="big-centered-h1">Photo Category #1</h1>
<div class="gallery-images">
<?php
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
$gallery_page_args = array(
'post_type' => 'attachment',
'posts_per_page' => 8,
'paged' => $paged,
'post_mime_type' =>'image'
);
$gallery_page_query = get_posts($gallery_page_args);
if ($gallery_page_query) {
foreach ($gallery_page_query as $attachment) {
echo '<a class="img-lightbox-wrapper" href="';
echo wp_get_attachment_url($attachment->ID);
echo '">';
echo '<img class="gallery-image" src="';
echo wp_get_attachment_thumb_url($attachment->ID);
echo '">';
echo '</a>';
}
$gallery_page_pagination_args = array(
'total' => $gallery_page_query->max_num_pages,
'prev_text' => 'Go Back',
'next_text' => 'See More'
);
echo '<div class="clearfix"></div>';
echo paginate_links($gallery_page_pagination_args);
echo '<div class="clearfix"></div>';
}
?>
</div>
</div>
</div>
</div>
<?php get_footer(); ?>
Any help would be greatly appreciated!