サポート » テーマ » アコーディオンリストのループについて

  • archive.phpへ、アコーディオン開閉のリストを作成し、「Smart Custom Fields」で吐き出しています。
    以下の通り繰り返しになるので、input idと、labelが同じ「tab-01」で吐き出されてしまい、困っております。

    <section class=”graduationBox”>
    <?php if(have_posts()):while(have_posts()):the_post();?>
    <!?TabStart?>
    <div class=”cp_actab”>
    <input id=”tab-01″ type=”checkbox” name=”tabs2″>
    <label for=”tab-01″><?php the_title(); ?></label>
    <div class=”cp_actab-content”>

    <?php
    $graduation_school = SCF::get(‘graduation_school’);
    if($post->school){
    foreach ($graduation_school as $fields ) {
    ?>
    <?php echo $fields[‘school’]; ?>
    <?php } }else{ ?>現在表示できる情報がありません
    <?php } ?>

    </div>
    </div>
    <?php endwhile;endif;?>
    </section>

    これを、

    <input id=”tab-02″ type=”checkbox” name=”tabs2″>
    <label for=”tab-02″><?php the_title(); ?></label>

    <input id=”tab-03″ type=”checkbox” name=”tabs2″>
    <label for=”tab-03″><?php the_title(); ?></label>

    といったように、連番で吐き出されるようにはできないでしょうか?
    どなたかご教授いただけませんでしょうか。
    よろしくお願いいたします。

  • トピック「アコーディオンリストのループについて」には新たに返信することはできません。