Ajax Wordpress自定义最后一篇文章分页
我想在头版的最后一篇文章中添加分页功能,但我一直失败。。! 我的代码:Ajax Wordpress自定义最后一篇文章分页,ajax,wordpress,pagination,ajaxify,Ajax,Wordpress,Pagination,Ajaxify,我想在头版的最后一篇文章中添加分页功能,但我一直失败。。! 我的代码: 标题
标题
我有一个ajaxify我的“more…”按钮,所以我想对分页做同样的操作:)
对不起,我的英语不好…你需要使用
query\u posts
而不是Wp\u query
某些时间分页在Wp\u查询中不起作用
试试这个:
1)
(二)
<?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; ?>