柔軟コンテンツ テンプレート

<?php while(has_sub_field('page_article_block01')): $x++; ?>
    <?php if( get_sub_field('page_article') ): ?>
    <?php while( the_flexible_field("page_article") ): ?>
        <?php if( get_row_layout() == "page_article_title02" ): ?>
        <h2 class="post-title"><?php the_sub_field('page_article_h2'); ?></h2>
        <?php elseif( get_row_layout() == "page_article_title03" ): ?>
        <h3 class="post-title"><?php the_sub_field('page_article_h3'); ?></h3>
        <?php elseif( get_row_layout() == "page_article_title04" ): ?>
        <h4 class="post-title"><?php the_sub_field('page_article_h4'); ?></h4>
        <?php elseif( get_row_layout() == "page_article_text" ): ?>
        <div class="editer"><?php the_sub_field('page_article_editer'); ?></div>
        <?php elseif( get_row_layout() == "page_article_list01" ): ?>
        <?php if(have_rows('page_article_ul')): ?>
        <div class="editer">
        <ul>
        <?php while(have_rows('page_article_ul')) : the_row();?>
        <li><?php the_sub_field('page_article_ul_li');?></li>
        <?php endwhile; ?>
        </ul>
        </div>
        <?php endif; ?>
        <?php elseif( get_row_layout() == "page_article_list02" ): ?>
        <?php if(have_rows('page_article_dl')): ?>
        <div class="editer">
        <dl>
        <?php while(have_rows('page_article_dl')) : the_row();?>
        <dt><?php the_sub_field('page_article_dt');?></dt>
        <dd><?php the_sub_field('page_article_dd');?></dd>
        <?php endwhile; ?>
        </dl>
        </div>
        <?php endif; ?>
        <?php elseif( get_row_layout() == "page_article_list03" ): ?>
        <?php if(have_rows('page_article_ol')): ?>
        <div class="editer">
        <ol>
        <?php while(have_rows('page_article_ol')) : the_row();?>
        <li><?php the_sub_field('page_article_ol_li');?></li>
        <?php endwhile; ?>
        </ol>
        </div>
        <?php endif; ?>
        <?php elseif( get_row_layout() == "page_article_img01" ): ?>
        <?php if(have_rows('page_article_img')): ?>
        <div class="editer">
        <?php while(have_rows('page_article_img')) : the_row();?>
        <figure>
        <img src="<?php the_sub_field('page_article_img_figure');?>" alt="">
        <figcaption><?php the_sub_field('page_article_img_figcaption');?></figcaption>
        </figure>
        <?php endwhile; ?>
        </div>
        <?php endif; ?>
        <?php endif; ?>
    <?php endwhile; ?>
    <?php endif; ?>
<?php endwhile; ?>