Home › Forums › General Issues › How to filter taxonomy terms? › Reply To: How to filter taxonomy terms?
Hi @ruriko,
Thanks for the post.
I am not sure I have clearly understood the use case, but if you want to list the Taxonomy terms, you can add the following snippet to your template:
<?php
//Get and loop over multiple selected term objects
$terms = get_field('taxonomy_field_name');
if( $terms ): ?>
<ul>
<?php foreach( $terms as $term ): ?>
<h2><?php echo $term->name; ?></h2>
<p><?php echo $term->description; ?></p>
<a href="<?php echo get_term_link( $term ); ?>">View all '<?php echo $term->name; ?>' posts</a>
<?php endforeach; ?>
</ul>
<?php endif; ?>
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.