我想在我的首页最后一篇文章中添加分页,但我一直失败..!我的代码:
<?php
$recentPosts = new WP_Query();
$recentPosts->query('showposts=4&cat=3');
?>
<?php while ($recentPosts->have_posts()) : $recentPosts->the_post(); ?>
<div id="thepost">
<div class="view view-fifth">
<?php if ( has_post_thumbnail()) : the_post_thumbnail('thumbnail'); endif; ?>
<div class="mask">
<h2>title</h2>
<p><?php echo get_the_date(); ?></p>
</div>
</div>
<p class="posttitle"><a class="ajax" href="<?php the_permalink(); ?>" rel="<?php the_ID(); ?>"><?php the_title(); ?></a></p>
<hr class="hr"/>
<p class="postcontent"><?php echo substr(strip_tags($post->post_content), 42, 120);?>... <a class="ajax" href="<?php the_permalink(); ?>" rel="<?php the_ID(); ?>">more...</a></p>
</div>
<?php endwhile; ?>
我有 ajaxify 我的“更多...”按钮,所以我想为分页做同样的事情:) 对不起我的英语不好...