Wordpress查询将不允许我查询我的所有自定义帖子

时间:2013-08-11 16:29:02

标签: php mysql wordpress

基本上,我几乎不知道为什么我的WP网站只能运行一个类型的766自定义帖子(实际帖子)的查询。

我有26,000个帖子属于一个自定义帖子类型,但无法全部查询,因为它只允许我查询第一个766,然后停在第767号。

编辑:

从我调试网站的一些评论中发现我的查询问题没有错误。我使用了define('WP_DEBUG_DISPLAY',true);并没有在哪里。

您可以在此处找到您要查看的公开网址:http://universitycompare.com/test/

正如您在此处看到的那样,它仅显示766个自定义帖子,但是当它达到767时,查询将停止并且不会在那里工作。我需要一种方法将“博客页面最多显示”的阅读设置设置为无限制。 (或30k +)

以前有人遇到过这个问题吗?如果有任何关于它如何修复的想法? - 我在这里发布了这个,因为在网上没有任何反馈/线索,但有一种感觉可能是MySQL问题或Wordpress问题? - 我只是不确定。

同样仅供参考,我可以在此处找到我用于查询的代码:

<?php //wp_reset_query();  // Restore global post data stomped by the_post(). ?>

<?php 

// args
$args = array(
    'post_type' => 'uc_course',
    'order' => 'DESC'
);

// get results
$the_query = new WP_Query( $args );

// The Loop
?>
<?php if( $the_query->have_posts() ): ?>
    <ul>
    <?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
    <?php $object = get_field('university') ?>
        <?php if( $object->post_title == "University of Aberdeen" ) { ?>
        <li>
            <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
        </li>
        <?php } ?>
    <?php endwhile; ?>
    </ul>
<?php endif; ?>

<?php wp_reset_query();  // Restore global post data stomped by the_post(). ?>

0 个答案:

没有答案