A WordPress taxonomy is a way to organize groups of posts and custom post types. By default, WordPress comes with two taxonomies called categories and tags. However, if you are using a custom post type, then you may need custom taxonomies.
There are two types of custom taxonomies.
- Hierarchical Taxonomy (works like categories)
- Non-Hierarchical Taxonomy (works like tags)
For instance, you can create a custom post type called ‘Quotes’ and sort it using custom taxonomies ‘Topics’ and ‘Writers’. Each topic and each writer is a term.
What if you want to display a list of topics or a list of writers with their posts number?
WordPress has pre-made categories and tag cloud widget. But there is no widget to show custom taxonomy terms list.

Categories widget’s output will be something like this:

How can we achieve similar result for custom taxonomies?
Add following code to the template where you want to show the list:
$custom_cats = get_terms('quote-writer');
echo '<ul>';
foreach ( $custom_cats as $term ) {
$term_link = get_term_link( $term);
echo '<li><a href="'.$term_link.'">'.$term->name . ' (' . $term->count . ')</a></li>';
}
echo '</ul>';
Change ‘quote-writer‘ to your custom taxonomy name. This works for both hierarchical and non-hierarchical taxonomy.
You can even use ‘category‘ or ‘post_tag‘ here to get the list of categories or tags.
Let me know if this works for you or not.
If you want to paginate the list of custom taxonomy terms, follow this tutorial: How to Paginate Taxonomy Terms with Posts Number
How would you add a custom field already created?
For example, you create a custom field with afc called “pdf” and you want the link to appear below. How do you make it work?
Because I have been tested with:
$ pdf = get_field (‘pdf’, $ term-> name. ‘_’. $ term-> term_id);
And with:
$ pdf = get_field (‘pdf’, $ term);
but I can’t make it work.
Test following code and if it doesn’t work, reach ACF support.
$term = get_queried_object();
$pdf = get_field('pdf', $term);