0

コンテンツ領域のすべてのサブページのページリストを取得しようとしています..しかし、以下のコードを使用すると、40個のサブページのうち10個しか表示されません...

修正方法を教えてください。

<ul class="subpages-pro" style="margin-top:20px;">
<span style="display:none;"><?php the_ID(); ?></span>
<?php $parent = $post->ID; ?>
<?php
query_posts('order=ASC&post_type=page&post_parent='.$parent);
 while (have_posts()) : the_post();
?>

<?php $image_thumb = get_post_meta($post->ID, 'image-thumb', true); ?>
<li><?php the_post_thumbnail(); ?>
<h4><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h4>
<?php the_excerpt(); ?>
</li>

<?php endwhile; ?>
</ul>
4

1 に答える 1

2

query_posts 関数に引数 numberposts = -1 を渡すと、すべてのページが表示されます。

したがって、query_posts への呼び出しを次のように変更します。

query_posts ('order=ASC&post_type=page&numberposts=-1&post_parent='.$parent)
于 2013-02-24T22:45:10.030 に答える