Possible Duplicate:
Pagination not working with custom loop
Custom Post Type Pagination & duplicate posts
Content is duplicating on one particular page template only - the photo gallery page.
Additional galleries are posted and adding pages but same 1st 3 galleries show when you click on the different pages. Any advice is much appreciated!
Here's the current php code:
<?php
/*
Template Name: Photo Gallery
*/
?>
<?php get_header(); ?>
<?php $options = get_option('dancefloor_theme_options_layout'); $theme_layout = $options['design']; if (!$theme_layout) $theme_layout = "left";?>
<div class="container">
<div class="contents-<?php echo $theme_layout ?>" style="padding-top:16px;">
<?php $query = new WP_Query(array( 'category_name' => 'gallery' )); if ( $query->have_posts() ): while ( $query->have_posts() ) : $query->the_post(); ?> <div class="post-wrapper">
<h2 class="title"><a href="<?php the_permalink() ?>"><?php the_title();?></a></h2>
<div class="post-container gall">
<h4 class="post-date"><?php the_time('M'); ?><span><?php the_time('j'); ?></span></h4>
<div class="featured-pic-wrapper gall">
<a href="<?php the_permalink() ?>">
<?php gorilla_img('gallsingle');?></a>
</div>
<div class="post-data">
<div class="btn-wrapper">
<a class="read-more-btn gall" href="<?php the_permalink() ?>"><?php _e('View Gallery »','language');?></a>
<p><?php the_tags('Posted in: ', ', ', ' '); ?></p>
</div>
</div>
</div>
</div><!-- post wrapper closed -->
<?php endwhile; endif; ?>
<?php theme_pagination( $query->max_num_pages); ?>
</div><!-- content closed -->
<?php get_sidebar(); ?>
</div><!-- container closed -->
<?php get_footer(); ?>