Pagination not working properly on author and category archives
I've made a category page that has pagination on the bottom of it. Everytime i try to go to page 2, the URL structure changes but the posts from my loop do not. The pagination is working fine for the blog page with almost the exact same loop. Any hints to what I could be doing wrong? I am also using the Wp-Paginate plug in.
<ul class="blogpostings">
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post();?>
<li>
<?php if ( has_post_thumbnail() ):?>
<?php
$image_id = get_post_thumbnail_id();
$image_url = wp_get_attachment_image_src($image_id, 'thumbnail', true);
echo '<a href="' . get_permalink($post->ID) . '" title="' . get_the_title($post->ID) . '"><img src="' . $image_url[0] . '" title="' . get_the_title($post->ID) . '" alt="' . get_the_title($post->ID) . '" /></a>';
?>
<?php endif; ?>
<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2><br/>
<h3><?php the_author_posts_link(); ?> <span class="date">| <?php the_time('F d, Y') ?> |</span> <?php comments_popup_link('Post Comment', '1 Comment »', '% Comments »'); ?>
<fb:like href="<?php the_permalink() ?>" layout="button_count" width="100" font="lucida grande"></fb:like>
</h3>
<?php the_excerpt(); ?>
<p class="postreadmore"><a href="<?php the_permalink() ?>" class="arrow"> Read Mor开发者_运维技巧e </a></p>
</li>
<?php endwhile; ?>
</ul>
<?php if(function_exists('wp_pagenavi')) { wp_pagenavi(); } else { ?>
<?php if(function_exists('wp_paginate')) {
wp_paginate();
} ?>
<?php } ?>
<?php endif; ?>
</div>
If you are using query_posts()
, make sure you are including the paged
parameter. The following should help: http://ivanasetiawan.com/wp-pagination-stays-on-the-same-page/
精彩评论