你好@Bundarr:
将以下基本示例作为一个独立文件进行测试,它看起来像是按照预期工作,而不是按照您的报告工作:
<?php
include \'../wp-load.php\';
header(\'Content-type: text/plain\');
$q = new WP_Query(array(
\'post_type\'=>array(\'publications\', \'page\')
\'posts_per_page\' => -1,
));
echo "SQL: {$q->request}\\n";
foreach($q->posts as $post) {
echo "{$post->post_name} - {$post->post_type}\\n";
}
所以,我只能假设您有一些插件或主题代码以某种方式被阻塞?
或者可能很简单\'posts_per_page\' => -1
参数,从而只显示有限的数字,并使其看起来好像不起作用?具有\'posts_per_page\'
查询如下所示(-1表示“无限制”):
$q = new WP_Query(array(
\'post_type\'=>array(\'publications\', \'page\')
\'posts_per_page\' => -1,
));