Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/loops/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
按文章编号检索某些文章时出现Wordpress问题?_Wordpress_Loops_Post - Fatal编程技术网

按文章编号检索某些文章时出现Wordpress问题?

按文章编号检索某些文章时出现Wordpress问题?,wordpress,loops,post,Wordpress,Loops,Post,我之前问过一个问题,关于这里的同一个问题: 一切都很顺利,我打了4个帖子,但问题突然出现,现在只出现了3个 这是我使用的代码 <?php $recent = new WP_Query( array( 'post__in' => array( 264, 137, 145 , 88 ) ) ); while($recent->have_posts()) : $recent->the_post();?> "> 我的代码有什么问题?? 我确信这些帖子数量是正确的,我

我之前问过一个问题,关于这里的同一个问题:

一切都很顺利,我打了4个帖子,但问题突然出现,现在只出现了3个

这是我使用的代码

<?php $recent = new WP_Query( array( 'post__in' => array( 264, 137, 145 , 88 ) ) ); while($recent->have_posts()) : $recent->the_post();?>

"> 我的代码有什么问题??
我确信这些帖子数量是正确的,我尝试了很多,并且都有相同的效果

从“博客页面最多显示”设置中获得不同数量的帖子,只需在查询中添加一个
每页帖子数
参数。如果您在
中也使用
帖子数,您可能希望将其设置为
-1所以所有的帖子都会被返回

new WP_Query(array(
  'post__in' => array(264, 137, 145 , 88),
  'posts_per_page' => -1
));

你把Wordpress设置为每页只显示3篇文章吗?哇,我都没想到!是的,“博客页面最多显示”的默认设置“那时我才3岁,我以前没注意到。非常感谢Richard.顺便问一下,有没有办法覆盖默认数字?我已经坐到10点了,但万一我需要在别的地方做的话。还有,你为什么不把你的评论贴出来作为答案,把它标记为真实的呢?再次感谢你的努力