我正在尝试获取一个类别中的帖子列表,其中包含以下内容:
$category = get_the_category();
$args = array(
\'post_type\' => array(\'post\', \'entrevista\'),
\'cat\' => $category[0]->term_id,
\'post__not_in\' => array(get_the_ID()),
\'ignore_sticky_posts\' => 1,
\'posts_per_page\' => -1
);
$queryScience = new WP_Query( $args );
unset($args);
?>
<?php if ( $queryScience->have_posts() ) : while ( $queryScience->have_posts() ) : ?>
<option value="<?php echo get_permalink($queryScience->post->ID); ?>"><?php echo ucwords(get_the_date(\'M Y\', $queryScience->post->ID)); ?></option>
<?php endwhile; endif; wp_reset_query(); wp_reset_postdata(); ?>
我认为它会无限循环,因为它显示了超过40000个结果。我做错了什么?