• 親ページに子ページ一覧を表示させようと、以下のループを記述しましたが、
    「表示設定」の「1ページに表示する最大投稿数」以上をループしてくれません。

    <?php if ( $post->post_parent == 0 ) : ?>
    <?php $child_posts = new WP_Query(array( ‘post_type’ => ‘page’, ‘order’ => ‘ASC’,’post_parent’ => $post->ID ) ); ?>

    <?php if( $child_posts->have_posts() ): ?>
    <?php while ($child_posts->have_posts()) : $child_posts->the_post(); ?>

    <div class=”child-page clearfix”>
    <h2>” title=”<?php the_title_attribute(); ?>”><?php the_title(); ?></h2>
    <div class=”in_child-page”><div class=”grid2 first”><?php the_post_thumbnail(‘medium_thumbnail’) ; ?></div>
    <div class=”grid9 excerpt”><?php the_excerpt(); ?>
    ” title=”<?php the_title_attribute(); ?>” class=”link”>> VIEW ALL</div>
    <div class=”clft”></div></div>
    </div>

    <?php endwhile; wp_reset_postdata(); ?>
    <?php endif; ?>
    <?php endif; ?>

    これを、子ページがある数だけ繰り返すように変更したいのですが、どうすればよいのかわかりません。

2件の返信を表示中 - 1 - 2件目 (全2件中)
2件の返信を表示中 - 1 - 2件目 (全2件中)
  • トピック「一覧表示する子ページの数に制限がかかります。」には新たに返信することはできません。