You can use the count
property of the taxonomy term and if it is > 1
, then show the term linked to archive.
// inside loop, get the terms of a custom taxonomy for the current post
$terms = get_the_terms( get_the_ID(), 'your_custom_taxonomy' );
// cycle the terms and display the name, linked to archive if term count is > 1
foreach ( $terms as $term ) {
$link = $term->count > 1 ? get_term_link( $term, $term->taxonomy ) : FALSE;
echo '<li>';
if ( $link ) echo '<a href="' . $link . '">'; // open link if needed
echo $term->name; // always show term name
if ( $link ) echo '</a>'; // close link if needed
echo '</li>';
}
Related Posts:
- List all taxonomy terms / Show links if posts are attached, else names
- How to use a Term Meta Field as a link
- How to show a hierarchical terms list?
- Automatically Assign Parent Terms When A Child Term is Selected
- Control term order on a per-post basis
- Wondering how to turn your firefox bookmarks into a WordPress blog?
- How do I list custom taxonomy terms without the links?
- Exclude posts that only have the ‘Uncategorized’ category [duplicate]
- wp_insert_term doesn’t work with custom post type’s taxonomy
- How can I find all internal links that are pointing to post/page?
- Custom Taxonomy Only Showing Top Level Terms in Admin?
- display multiple term post from taxonomy in a single page
- How to find objects by terms
- Using get_terms for custom taxonomy in functions.php
- Is it possible to get a Previous/Next Taxonomy term archive URL?
- get_post_terms not working as expected
- widget to output a link to archive view
- Get posts that matches specific terms of multiple custom taxonomies
- how can i add a menu link that goes to an external page
- Remove all links to a specific website
- Display empty taxonomy terms with get_terms()
- Adding Multiple Values to a Post Meta Key
- Open link in a new tab checked by default when adding a new link in visual post editor
- Getting only the most recent bookmark?
- WordPress built-in method to extract array of term IDs?
- Create anchor from Wysiwyg editor
- display taxonomy slug from term ID
- get_terms problem : related articles
- Why “Warning: Invalid argument supplied for foreach()”
- WordPress User Taxonomy Saved Values
- Avoid duplicate post from same Taxonomy
- Linking from Menu and a Page to the latest post from a specific category
- get_the_terms error
- get_term and get_term_by return null or false, even though term exists
- get_terms that have custom sticky field checked
- Get authors by term id or slug
- Setting posts_per_page for taxonomy term template
- Get term siblings of current child taxonomy
- Is There a Difference Between Taxonomies and Categories?
- How to link to local post
- Output terms for custom post types
- How can I show different image links for different languages with qTranslate?
- Comma separated tax terms, with “and” before last item [duplicate]
- Taxonomy term page going to 404
- Get posts from multiple tax terms
- Get Link to Feed On Term or Taxonomy
- Moving a wordpress.org website to another domain name?
- How do I make WordPress “Page” link in the top nav bar go to an external URL?
- one post per term taxonomy
- How can I change the output display of my pagination?
- How to remove a link of date archive
- Blogroll links sorted by category in a table
- How to display taxonomy term custom meta (using wp_get_object_terms?)?
- Button linking to an unique link
- Related posts for a post
- Retrieve all term IDs of post
- Use wp_list_categories to list parent categories from actual term
- Converting a hierarchy of off-site web-links to Word-Press
- Trash Bin for Categories?
- update_term_meta not working
- Remove the preview link box since 6.0 update
- Link to downloadable excel sheet on website leads to unfinished version of document
- How to find what pages are internally linking to a page?
- Order posts by taxonomy terms
- Retrieve the child terms by having the parent’s information
- Split taxonomies on different pages
- How to download file without login to wordpress account?
- How to create a non removable taxonomy term?
- How to add a target to a link
- I want to change the slugs of my terms dynamically
- Displaying Most Recently Edited Post
- taxonomy_edit_form_fields output after term fields
- Pages of my taxonomy terms are showing all posts
- taxquery taxonomy get terms
- $product->ID in has_term() not working, but manually inputting the ID works, why?
- how do you get one specific term from a shortcode attribute?
- Why get_terms() behaves strangely when being called in admin (for use in meta box)?
- My home page is still showing link “localhost” [duplicate]
- WordPress Intranet Link Not Working
- Display current taxonomy slug in a post
- qtranslate-x problem with custom term description
- WordPress add taxonomies/terms list as a menu in archive page
- Anchor link on single.php
- WordPress link management
- Adding Edit subnav link to Custom Buddypress Profile Tab [closed]
- Term specific featured post on taxonomy archive pages
- Create an additional template page for every term taxonomy
- Taxonomy Grid Archive Help?
- Weird characters being added to my link
- Custom terms in custom category taxonomy
- How to associate an image with a term taxononmy and publish it on frontpage?
- How to get all the terms of a post
- List a custom post type’s posts ordered by nested custom taxonomy
- Display yesterday’s last post’s Custom field from Unique terms of one Taxonomies
- Author template – separate custom post type by custom taxonomy term for $curauth
- External Link issue in Visual Form Builder Pro
- How to Link to WP Pages Internally and Extenally
- What is making these links open as new windows?
- tinymce “Link” popup throwing error, not working
- WordPress taxonomy and terms question