• Hello,

    I am running into an issue where my I am using <?php query_posts(‘showposts=6’); ?>
    in order to only display 6 posts per page.

    It appears all and well but when I click on any page listed in the pagination generated, the 404 page appears.

    I have seen a lot write up on this but have not come to a solution. My code is shown below.

    <?php query_posts('showposts=6'); ?><?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    
    							<article id="post-<?php the_ID(); ?>" <?php post_class('clearfix'); ?> role="article">
    
    								<section class="entry-content">
    									<div class="post-image">
    									<?php the_post_thumbnail( 'custom-thumb' ); ?>
    									</div> <!-- post-image  post image ADDED -->
    
    									<header class="article-header">
    										<div class="event-date h2"><?php echo get_post_meta($post->ID, 'Date', true); ?></div>
    
    										<h1 class="h2"><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></h1>
    									</header> <!-- end article header -->
    
    									<!-- <?php the_content(); ?> REMOVED and replaced with the excerpt below-->
    									<?php the_excerpt(); ?>
    
    								</section> <!-- end article section -->
    
    								<footer class="article-footer">
    									<p class="tags"><?php the_tags('<span class="tags-title">' . __('Tags:', 'bonestheme') . '</span> ', ', ', ''); ?></p>
    
    								</footer> <!-- end article footer -->
    
    								<?php // comments_template(); // uncomment if you want to use them ?>
    
    							</article> <!-- end article -->
    
    							<?php endwhile; ?>
    
    									<!-- bones_page_navi WAS HERE BUT HAS BEEN MOVED. IT IS NOW LOWER IN THE CODE. -->
    
    							<?php else : ?>
    
    									<article id="post-not-found" class="hentry clearfix">
    											<header class="article-header">
    												<h1><?php _e("Oops, Post Not Found!", "bonestheme"); ?></h1>
    										</header>
    											<section class="entry-content">
    												<p><?php _e("Uh Oh. Something is missing. Try double checking things.", "bonestheme"); ?></p>
    										</section>
    										<footer class="article-footer">
    												<p><?php _e("This is the error message in the index.php template.", "bonestheme"); ?></p>
    										</footer>
    									</article>
    							<?php endif; ?>
    
    						</div> <!-- end #main -->
    
    						<div id="all-events" class="clearfix">
    							<?php if (function_exists('bones_page_navi')) { ?>
    											<?php bones_page_navi(); ?>
    									<?php } else { ?>
    											<nav class="wp-prev-next">
    													<ul class="clearfix">
    														<li class="prev-link"><?php next_posts_link(__('&laquo; Older Entries', "bonestheme")) ?></li>
    														<li class="next-link"><?php previous_posts_link(__('Newer Entries &raquo;', "bonestheme")) ?></li>
    													</ul>
    											</nav>
    									<?php } ?>
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Query Post breaking pagination’ is closed to new replies.