secret
Created

wordpress pagination problem

  • Download Gist
gistfile1.txt
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
<?php get_header(); ?>
<article class="main">
<?php
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
query_posts('posts_per_page=6&paged=' . $paged);
?>
 
<?php get_sidebar(); ?>
<div class="blogIndex">
<h2>Latest Posts</h2>
<?php query_posts('cat=-3,-9,-10,-11,-12,-13,-14'); ?>
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
 
<article>
<a href="<?php the_permalink(); ?>"><?php the_post_thumbnail(); ?></a>
<h2><a href="<?php esc_url( the_permalink() ); ?>" title="Click to view: <?php the_title(); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
<!--time datetime="<?php the_time( 'Y-m-d' ); ?>" pubdate><?php the_date(); ?><?php //the_time(); ?></time-->
<?php the_excerpt(); ?>
<p class="button"><a href="<?php the_permalink(); ?>">read full post</a></p>
</article>
 
 
<?php endwhile; else: ?>
<p>Sorry, no posts matched your criteria.</p>
</div>
<?php endif; ?>
<?php if ( $wp_query->max_num_pages > 1 ) : ?>
<div class="prevNext">
<p class="nextPostsLink"><?php next_posts_link( __( '&larr; Older posts', 'twentyten' ) ); ?></p>
<p class="previousPostsLink"><?php previous_posts_link( __( 'Newer posts &rarr;', 'twentyten' ) ); ?></p>
</div>
<?php endif; ?>
 
</article>
<?php get_footer(); ?>

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.