アドバンスカスタムフィールドの繰り返しフィールドについて
-
こんばんは。
アドバンスカスタムフィールドの繰り返しフィールドを使用しているのですが、複数あるサブフィールドの中で特定のサブフィールドが未入力の場合は表示しないようにしたいのですが、出来ずにつまづいています。<div id=”tab-1″>
<?php if(get_field(‘fields_group’)): ?>
<?php while(has_sub_field(‘fields_group’)): ?>
<table id=”group”>
<tbody>
<tr>
<th>サブフィールド①</th>
<td><?php the_sub_field(’sub_field01′); ?></td>
</tr>
<tr>
<th>サブフィールド②</th>
<td><?php the_sub_field(‘sub_field02’); ?></td>
</tr>
<tr>
<th>サブフィールド③</th>
<td><?php the_sub_field(‘sub_field03’); ?></td>
</tr>
</tbody>
</table>
<? endwhile; ?>
</div>
<?php endif; ?>例えば上の様な構成でサブフィールド②の<?php the_sub_field(‘sub_field02’); ?>の部分が未入力の場合はサブフィールド②の<tr></tr>の部分ごと非表示にしたいと思っています。
どなたかご教授いただけると幸いです。
よろしくお願いいたします。
4件の返信を表示中 - 1 - 4件目 (全4件中)
4件の返信を表示中 - 1 - 4件目 (全4件中)
- トピック「アドバンスカスタムフィールドの繰り返しフィールドについて」には新たに返信することはできません。