Skip to main content

Pagination stays on same page for post category

I have a custom taxonomy for a group of posts, and I also have a need to show these posts on a custom page template. I want to show one post at a time, with pagination, so that the user can click through them like a slide show.

My template correctly grabs the right category and display one (the first) post, but when I try to click through the pagination, it sends me to the archives for the next post. I want to click "next" and be taken to the next post within the same page template.

I've working with this solution, but I can't get it to work.

Here's my code, as it is...

<body <?php body_class(); ?>>
<div id="full-page">
    <div id="wrap">
        <div id="full-main-col">
            <a href="#" id="share" rel="prettySociable" title="Drag to Share"><img src="<?php echo get_template_directory_uri(); ?>/img/share.png" alt="" /></a>

            <?php if (have_posts()) :
                            while (have_posts()) :
                            the_post(); ?>
            
                                <div id="page-head">
                                    <?php the_title('<h1>', '</h1>');
                                    if (function_exists('dimox_breadcrumbs')) dimox_breadcrumbs(); ?>
                                </div>
            
                           <?php endwhile;
                        endif; ?>
            <?php include( TEMPLATEPATH . '/sidebar-right.php' ); ?>
            
            <?php
              query_posts( array( 'post_type' => 'fieldtrips', 'fieldtripcategory' => 'elementary-school-aquifer', 'order' => 'ASC', 'posts_per_page' => 1 ) );
              if ( have_posts() ) : while ( have_posts() ) : the_post();
            ?>
            
              <h3><?php the_title(); ?></h3>
              <?php the_content(); ?>
              
              <?php previous_post('&laquo; &laquo; %', '', 'yes'); ?> | <?php next_post('% &raquo; &raquo; ', '', 'yes'); ?>
            
            <?php endwhile; endif; wp_reset_query(); ?>
            
        </div>
    </div>
<?php
get_footer();
?>