You’ll need to use get_term_link(), e.g. change your $terms array to be HTML for the terms or links instead:
foreach( $taxonomy_terms as $term ) {
$term_link = get_term_link( $term->slug, $taxonomy );
if (! is_wp_error( $term_link ) ) {
$terms[] = '<a href="' . esc_url( $term_link ) . '">' . esc_html( $term->name )
. '</a>';
} else {
// Could not fetch link for this term
$terms[] = esc_html( $term->name );
}
}
Related Posts:
- How to use taxonomies on attachments with the new Media Library?
- How to display custom taxonomies in posts?
- Creating Custom Taxonomy without mapping to any post type
- Exclude specific slug in ‘get_terms’
- Hook to process a new taxonomy tag before it is created?
- Custom taxonomy on permalink
- How do I filter posts by taxomony using AJAX
- Multiple users – only allow them to manage their own terms for custom taxonomy when logged in
- How to return a list of custom taxonomy terms via the Gutenberg getEntityRecords method
- wp_options table value
- Custom Taxonomy Only Showing Top Level Terms in Admin?
- Get current term’s ID
- Is it possible to get a Previous/Next Taxonomy term archive URL?
- How to modify default taxonomy field to a single text field?
- How to set hierarchical terms to a post using wp_set_object_terms
- How do I display a tag cloud with both post tags AND a custom taxonomy?
- How to link categories to custom taxonomy terms?
- List taxonomy / category count showing list published posts only
- Save Filter for Taxonomies
- Create Child Taxonomies
- Allow only 1 instance of each term in each custom taxonomy
- get_terms: determine if taxonomy term has children
- Set a taxonomy as private
- “show option all” on list categories doesn’t display taxonomy
- Current category link filter
- display taxonomy slug from term ID
- Make a taxonomy column sortable in the admin?
- Redirect all child taxonomy to its parent
- Wrapping result of the_terms in a span with a class of the term name
- How to display custom taxonomy images on index.php?
- How do I taxonomy terms based on terms they are used alongside?
- How can I populate a select element with terms from a custom taxonomy and filter post results?
- How do I list the pages of a custom taxonomy?
- Get number of post who belongs in two taxonomies!
- What is faster: custom taxonomy or serialized post-meta for db retrieval? (over 60,000 posts)
- Get taxonomy based on another taxonomy slug
- Why does a new taxonomy term get created when I assign an existing term to a post?
- Add Image Uploader In Admin Panel
- Tell the difference between a term and page when they have the same ID
- Getting associated taxonomies
- How to use multiple archive templates for a taxonomy?
- Adding custom taxonomy in my existing category URL
- Custom Taxonomy Query
- WordPress implode & wp_insert_post question
- how can i display taxonomy instead of category on my web page?
- Taxonomy Meta Box in User Profile?
- Proper way to update the slug of a taxonomy using register_taxonomy? [duplicate]
- Displaying Custom Taxonomy without a hyperlink
- Get only immediate children (and not grandchildren) of a hierarchical custom taxonomy term
- How to group all terms children’s in custom taxonomy?
- My custom taxonomy page is leading in 404 page
- Show template part if part of term
- Corrupted nav-menu?
- Remove taxonomy widget from “PAGE” post
- List Top 5 taxonomy terms based on number of post
- Get list of taxonomies associated with users
- Register `product_cat` taxonomy for default post post type
- Custom Taxonomy Not Saving in Front End Post
- Taxonomy.php how to show post only in current taxonomy with wp_query?
- Don’t display taxonomy if empty
- Taxonomize taxonomy terms?
- Use wp_list_categories to list parent categories from actual term
- Include get_term_link inside search
- Set two terms for a post when they differ only by an accent
- Rewrite Search URL Permalink For CPT Custom Taxonomies
- How to add a dynamic dropdown derived from custom taxonomy
- Custom field with terms from another taxonomy programmatically
- Taxonomies and subtaxonomies relations
- Retrieve the child terms by having the parent’s information
- How to create a non removable taxonomy term?
- Can I get thumbnail of taxonomy?
- How to get all the terms from a custom hierarchical taxonomy via REST api?
- How to show category list in WordPress
- transfer two existing taxonomy terms into one custom metabox
- How can I rewrite a custom taxonomy archive slug
- How to add all existing Custom Taxonomy to Admin Menu Creations Interface?
- Why get_terms() behaves strangely when being called in admin (for use in meta box)?
- qtranslate-x problem with custom term description
- Templates files for custom post type with custom tags
- Display taxonomy posts
- Creating a Taxonomy Page [duplicate]
- Add image to taxonomy and output to homepage
- Looking for suggestions on creating simple database (Help!!)
- Extra fields on categories that is available via the WP-API?
- Child Pages and Custom Taxonomies
- Custom taxonomy – query returns an error
- How to perform a search inside a specific taxonomy category
- Sorting Custom Taxonomy in ASC/DESC order?
- How can i set post_per_page in my taxonamy?
- Exclude 2 in 3 terms of A Taxonomy from all Archives
- Get Posts with matching lowest taxonomies
- Loop custom post type by taxonomy (Category)
- Any way to make custom taxonomy field searchable?
- query posts returns 10 records
- Custom Search only for my Custom Taxonomy Page – data
- Insert taxonomy term to different table
- Getting taxonomies specific to categories
- Remove Tag Cloud Words from Custom Taxonomy
- How to add/enqueue Custom CSS for a custom taxonomy page?
- wp_get_object_terms count on taxonomies within an category archive