0
그래서 다음과 같은 경우 - 아래 코드에서 wpquery를 얻었습니다. 내가 달성하고자하는 어떤WPquery + 모든 n 번째 요소에 행 추가
<section class="row service_block_row bgf" id="page-<?php the_ID(); ?>">
<div class="container">
<div class="row">
<div class="col-sm-12">
<?php
$args = array(
'post_type' => 'page',
'posts_per_page' => -1,
'post_parent' => $post->ID,
'order' => 'ASC',
'orderby' => 'menu_order'
);
$parent = new WP_Query($args);
if ($parent->have_posts()) : ?>
<?php while ($parent->have_posts()) : $parent->the_post(); ?>
<div class="row">
<div class="col-sm-12 col-lg-3">
<h1><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h1>
</div>
</div>
<?php endwhile; ?>
<?php endif; wp_reset_query(); ?>
</div>
</div>
</div>
</section>
그렇게 작업 루프를하는 것입니다 :
이<ROW>
<COL-LG-3>
<COL-LG-3>
<COL-LG-3>
<COL-LG-3>
</ROW>
SO 사실 내가 달성하기 위해 LKE 것입니다 무슨 다른 루프를 생성하지 않고 행 내부의 4 개 요소를 가지고있다. 난 내가 어떤 카운터를 사용해야합니다 알고 있지만 어떻게 단서가 없다/
감사