プラグイン

カスタムフィールドの値でclassを出し分けする

2019/03/21

functions.php に判定を追加

リピートの場合

複数

 

フィールド名

color04

 

選択肢

text-red : 赤

text-blue : 青

text-green : 緑

 

書き出し

<span class=”<?php the_sub_field(‘color04’); ?>”>