I was able to achieve this by following code:
$allterms = get_terms( $taxonomy );
$pterms = get_the_terms( $post->ID, $taxonomy);
$tag_list = implode(',', wp_list_pluck($pterms, 'term_id') );
$t = explode(',', $tag_list);
echo '<div class="tag-cloud">';
foreach ($allterms as $term)
{
if (in_array($term->term_id, $t))
{
echo '<span class="stag active">'.$term->name.'</span>';
}
else
{ echo '<span class="stag inactive">'.$term->name.'</span>'; }
}
echo '</div>';
Related Posts:
- How to remove the tag cloud from custom taxonomy admin page?
- Custom columns on edit-tags.php main page
- custom post type taxonomy “tag” archive : no post found
- Exclude Specific Term from Search
- Can I turn off write-in tags/taxonomies?
- Is it possible to use one slug for Multiple Taxonomies?
- Widget to display custom taxonomy tag cloud
- Post tags saving as both tag name & tag ID on post update when tags are displayed as checkboxes
- Non-hierarchical custom taxonomy using checkboxes on edit-screen -> saving issue
- How to display and use all existing tags at my write-post-at-frontend-panel?
- how to get title to custom tags page
- How do I display a tag cloud with both post tags AND a custom taxonomy?
- Can I turn off write-in tags/taxonomies?
- WordPress renames slug of tags used in multiple taxonomies?
- Allow only 1 instance of each term in each custom taxonomy
- How do I make a custom taxomony appear like tags?
- Make tag cloud links consistent
- Hook to change Custom Tag Taxonomy Links?
- How to adjust code to refresh a dropdown box with tags that are active on filtered category listing
- Metabox to list/store a certain type of post tag
- Sorting Tags by Slug Value
- Extend & Search Native WordPress Image Galleries With Tags and Taxonomies?
- How to filter a post in the Tag Cloud widget, using tags of a media library image attached to the post?
- Replace taxonomy permalinks
- Front-End Custom Taxonomy Tag Select
- Create custom taxonomy and Display in metabox dropdown
- Problem with removing post tags programmatically
- How to get custom category’s link?
- saving meta/custom field to tag
- Changing input type from text to multi select dropdown – skill taxonomy
- Displaying user selected custom tags/taxonomies on the front-end
- Featured Images for Tags?
- Displaying the post count of all custom taxonomy terms in a list format
- Automatically tag posts based on user-defined words [closed]
- making an index from custom taxonomies and tags of posts (not hierarchical taxonomy)
- Set two terms for a post when they differ only by an accent
- Get tags name under custom taxonomy in wordpress
- Filter Tags for current users
- Limit Tag Links in Post Content
- Change the Page Title of the Archive Page for Portfolio Tags
- Get Posts by tag from a custom taxonomy
- Display the first tag assigned to a post
- Display custom post taxonomies
- How to randomise a custom taxonomy tag cloud
- How do i change the tags and taxonomies
- Any way to make custom taxonomy field searchable?
- How to get tags with custom taxonomy field?
- Primary Taxonomy for Post
- Group custom taxonomies based on tags contained in their posts
- Get term SLUG by term ID
- WordPress taxonomy radio buttons
- Custom taxonomy, get_the_terms, listing in order of parent > child
- Get taxonomy names by post id
- restrict_manage_posts not working in 3.3.1
- Custom taxonomy on users with UI
- Echo Custom Taxonomy Field Values Outside the Loop
- Restricting Users to view only Custom Taxonomies they have entered?
- Custom taxonomy parent from another taxonomy
- How to create drop down for child categories of current taxonomy being viewed?
- How to dynamically add custom taxonomy terms as a sub-menu of an existing menu item, using custom walker class
- Get terms ordered by post date
- Date archive permalinks for custom taxonomy
- Custom Taxonomies Cababilities
- Get posts from taxonomy URL
- How to implement custom search with input fields?
- Custom taxonomy [year] is directing to yearly archive
- Listing tags from a custom post type
- Custom Taxonomy isn’t working from frontend post submitting
- Base permalink for custom taxonomy
- put custom taxonomy slug in front of their respective term slugs
- Add success message to category add screen
- Prevent users from adding taxonomy terms
- Count Number of Posts in Taxonomy Term in Last 24 Hours
- Changing select options based on previous select with PHP & AJAX
- Query custom taxonomy by term id?
- How can I reduce amount of ifs and else ifs in this specific block of code?
- Get name of taxonomies of current page
- export and import taxonomy terms from one taxonomy to another
- Find terms in a custom taxonomy based on the hirearchy
- WooCommerce custom taxonomy as meta?
- Query custom taxonomy for category including children
- Filter by Custom Taxonomy AND Custom Field
- Custom Permalink Structure for terms/taxonomies of custom post type
- register_taxonomy for both ‘Post’ & ‘Page’
- Display custom taxanomy on woocommere product page
- How to structure all custom-taxonomy with three verbs(a,b,c) and route them accordingly?
- how do you pull data from two taxonomies?
- Restrict user to terms in a custom taxonomy registered for both posts and users
- WordPress search form and search result through ACF field in custom taxonomy
- Exporting Custom Taxonomy Description without Plugin
- How do I display post count of a custom post type with custom category taxonomy in wp_menu_nav?
- WordPress Main Menu with dynamic url
- Dynamic value for get_option linked to taxonomy term_id?
- Best Method to Switch Between Terms (Custom Taxonomy)
- Custom taxonomy applied to links [duplicate]
- Next/Previous links in custom taxonomy, where item may belong to multiple terms
- Custom Taxonomy + JQuery Tabs
- Custom Taxonomy Template Variables Available?
- i need to show featured post on custom taxonomy page
- Taxonomy entries are spawning copies of existing entries with the new title as the existing ID, since upgrade