Answers for "wordpress get taxonomy terms with custom fields"

PHP
0

show all terms of a custom taxonomy

$terms = get_terms( array(
  'taxonomy' => 'taxonomy_name_or_slug',
  'hide_empty' => true,
) );
foreach ($terms as $term){
  echo $term->slug;
  echo $term->name;
  echo "<br><br>";
}
Posted by: Guest on July-20-2020
1

wp get field taxonomy

<?php $terms = get_field('tech_choices');
$cat_icon = get_field('creative_icon', $queried_object); ?>
<span>
	<?php if( $terms ): ?>
	<ul>
		<?php foreach( $terms as $term ): ?>
		<li><a href="<?php echo get_term_link( $term ); ?>"><?php echo $term->name; ?></a></li>
		<?php $icon = get_field('creative_icon', $term->taxonomy . '_' . $term->term_id); echo $icon; ?>
		<?php endforeach; ?>
	</ul>
	<?php endif; ?>
</span>
Posted by: Guest on December-21-2021

Code answers related to "wordpress get taxonomy terms with custom fields"

Browse Popular Code Answers by Language