-
-
Save Tjobbe/b8fc2849ec3e16cdc809 to your computer and use it in GitHub Desktop.
wordpress pagination problem
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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( __( '← Older posts', 'twentyten' ) ); ?></p> | |
<p class="previousPostsLink"><?php previous_posts_link( __( 'Newer posts →', 'twentyten' ) ); ?></p> | |
</div> | |
<?php endif; ?> | |
</article> | |
<?php get_footer(); ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment