現在、タームの一覧を作成しているのですがAdvanced Custom Fieldsで、作成したタームのカスタムフィールドの取得方法がわからず困っています。
「ターム カスタムフィールド」で検索して色々試したのですが結局表示させることができませんでした。
どなたかご教授いただけませんでしょうか?
参考にしたサイトは以下でした。
https://hirashimatakumi.com/blog/1365.html
https://kaiza.jp/result/result-391/
下記は色々試した過程の一例です。
<ul> <?php $tags_list =array( 'hide_empty' => false ); $posttags = get_tags( $tags_list ); if ($posttags) { foreach($posttags as $tag) { $term_id = $tag->term_id; $term_field = get_field( 'フィールド名', $term_id ); ?> <li> <a href="<?php get_tag_link($tag->term_id); ?>"> <div> <?php echo $tag->name; ?> </div> <div> <?php echo $term_field; ?> </div> </a> </li> <?php } } ?> </ul>
よろしくお願い致します。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2018/09/07 07:04
2018/09/07 07:34
2018/09/07 07:39