我在functions.php中做了定制的帖子,所有这些都很好,但是我的循环只显示了9个帖子。我能做些什么给他们看呢?循环I使用:
<?php
$custompost_loop = new WP_Query($custompost);
if ($custompost_loop->have_posts()) : ?>
<?php while ($custompost_loop->have_posts()) : $custompost_loop->the_post();
?>
<div class="offer__single">
<h4 class="offer__title">
<?php echo get_the_title(); ?>
</h4>
</div>
<?php
endwhile;
?>
<?php endif;
wp_reset_postdata(); ?>发布于 2020-01-06 19:17:05
$custompost = array(
'posts_per_page' => -1,
'post_type' => 'your_post_type',
);
$custompost_loop = new WP_Query( $custompost );在这种情况下,可以将'posts_per_page' => -1,添加到$custompost数组中。
https://stackoverflow.com/questions/59617668
复制相似问题