Skip to content
Create a gist now

Instantly share code, notes, and snippets.

Embed URL


Subversion checkout URL

You can clone with
Download ZIP
wordpress pagination problem
<?php get_header(); ?>
<article class="main">
$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(); ?>
<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>
<?php endwhile; else: ?>
<p>Sorry, no posts matched your criteria.</p>
<?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>
<?php endif; ?>
<?php get_footer(); ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.