我必须手动挂载博客文章,但我不确定这是否是正确的工作方式,它只带9页,每篇有4个帖子,但博客有83个帖子!
<?php
$paged = get_query_var('paged');
$args = array(
'numberposts' => 4,
'offset' => $paged*4,
'orderby' => 'post_date',
'order' => 'DESC',
'post_type' => 'post',
'post_status' => 'publish',
'suppress_filters' => true
);
$posts_array = get_posts( $args );
?>
Run Code Online (Sandbox Code Playgroud)
不管怎么说,还是要谢谢你.
AJ *_*ane 79
问题是你的'numberposts'设置为4将它设置为-1以获取所有帖子:
'numberposts' => -1,
Run Code Online (Sandbox Code Playgroud)
如果您未在此处设置号码,WordPress将从您的仪表板设置中提取帖子数量(在"设置" - >"阅读"下)
| 归档时间: |
|
| 查看次数: |
25683 次 |
| 最近记录: |