Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $taxonomy = 'XXX'; // register_taxonomyで指定したタクソノミー名を指定
- $terms = get_terms($taxonomy);
- foreach ($terms as $term) :
- $thumb = get_field('カスタムフィールド名', $taxonomy.'_'.$term->term_id);
- $thumb_url = (!empty($thumb['url'])) ? $thumb['url'] : '/img/dummy.png';
- ?>
- 画像:<img src="<?php echo $thumb_url; ?>">
- <?php endforeach; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement