Warning: Undefined array key "css" in /home/dotequal/pub/ja-ja.jp/wp-content/themes/ja-ja/header-single.php on line 7

Warning: Trying to access array offset on value of type null in /home/dotequal/pub/ja-ja.jp/wp-content/themes/ja-ja/header-single.php on line 7

Warning: Undefined array key "jssrc" in /home/dotequal/pub/ja-ja.jp/wp-content/themes/ja-ja/header-single.php on line 8

Warning: Trying to access array offset on value of type null in /home/dotequal/pub/ja-ja.jp/wp-content/themes/ja-ja/header-single.php on line 8

Warning: Undefined array key "js" in /home/dotequal/pub/ja-ja.jp/wp-content/themes/ja-ja/header-single.php on line 9

Warning: Trying to access array offset on value of type null in /home/dotequal/pub/ja-ja.jp/wp-content/themes/ja-ja/header-single.php on line 9

Warning: Undefined variable $tn_js in /home/dotequal/pub/ja-ja.jp/wp-content/themes/ja-ja/header-single.php on line 59
advanced custom fields pro 繰り返しフィールドの値を取得・表示する方法 – どっといこ
WordPress  
  advanced custom fields pro 繰り返しフィールドの値を取得・表示する方法
2018
13
Nov

advanced custom fields pro 繰り返しフィールドの値を取得・表示する方法

最終更新日: 2022年4月15日

カスタムフィールドの値はget_post_custom で取得して foreach で回して表示しますが、アドバンスドカスタムフィールドプラグインにはちゃんと関数が用意されていました。

https://www.advancedcustomfields.com/resources/the_sub_field/より引用


if( have_rows('parent_field') ):

    while( have_rows('parent_field') ) : the_row(); 
        
        the_sub_field('sub_field');
			
    endwhile;

endif;

値を取得して加工したい場合は get_sub_field() が用意されています。

 

 

 

 

top


Warning: Undefined array key "jssrc" in /home/dotequal/pub/ja-ja.jp/wp-content/themes/ja-ja/footer-single.php on line 30

Warning: Trying to access array offset on value of type null in /home/dotequal/pub/ja-ja.jp/wp-content/themes/ja-ja/footer-single.php on line 30

Warning: Undefined array key "js" in /home/dotequal/pub/ja-ja.jp/wp-content/themes/ja-ja/footer-single.php on line 31

Warning: Trying to access array offset on value of type null in /home/dotequal/pub/ja-ja.jp/wp-content/themes/ja-ja/footer-single.php on line 31