When you are in a tag template, a body class is added with term-{termID}, so you can hook in “wp_generate_tag_cloud_data” to check if class is present and add custom class to the tag 😉
function tribalpixel_tag_cloud_class_active($tags_data) {
$body_class = get_body_class();
foreach ($tags_data as $key => $tag) {
if(in_array('term-'.$tag['id'], $body_class)) {
$tags_data[$key]['class'] = $tags_data[$key]['class'] ." active-tag";
}
}
return $tags_data;
}
add_filter('wp_generate_tag_cloud_data', 'tribalpixel_tag_cloud_class_active');
after that you simply use CSS to style 😉
Related Posts:
- Edit tag cloud widget number
- How to automatically apply woocommerce product title to all product images alt tags?
- show limited tags in an article
- display most popular tags in two columns
- Way to querry data (tags) from a wordpress database?
- Edit the_category (); for a hierarchical display
- Need to put a script above tag in header.php – WP 5.7.1
- Filtering a function’ output for a new continued function
- remove specificly the last tag in all posts
- Using Tag Groups: Displaying groups and adjacent tags of current post
- Notify admin (by email) if post added with specific tag
- Insert wordpress tags below posts via functions.php
- Using tag to output text in Genesis?
- Change background image based on tags
- how to loop through blog posts in php
- The search doesn’t work properly
- How to call a function only once (global variable scope)
- Multiple is_page() in page.php
- Set media upload attachment link to none and hide it in WP v3.5
- Fatal error: Call to undefined function plugin_dir_path()
- Switching wp_get_sites to get_sites
- Is it possible to get a theme customizer setting from wp.customize using jquery?
- One button to change all settings in theme customizer?
- Add custom image sizes to media uploader
- How can update custom meta for all posts
- How to add default images into theme customizer image control?
- Is $hook a global variable in WordPress
- Successful or Error Message after running mysql code in functions.php
- Getting rid of role=”navigation” in the Home Page Pagination
- How to use return in my custom function instead of echo
- syntax issue on php 7.4
- How can I use wp_insert_comment to write a comment when a post is edited?
- How to remove the excerpt in the Dzonia Lite theme
- How do you add customer capability after Woocommerce purchase?
- Get first URL from post content
- Setting custom canonical urls
- Trigger popup in a php if/else statement
- Setting a cookie upon specific URL visit
- get post based on category chosen in drop down – The ajax method
- how to make separate field in wordpress user_data_
- How to put a variable in a instance in the widget
- How to output a PHP file values by shortcode?
- Set the background to a default image if there isn’t a specified “featured image”
- get a simple array of all of the term names that exist in all taxonomies
- Logged in user ID as post ID
- WordPress Access allowed to fewer pages till user logs in
- Show categories then when clicked on a category list all sub category and when clicked show all posts in that sub category
- How to store data from multiple forms using ajax and php
- How to control WordPress image metadata (using Imagick)?
- different id for same element visual composer [closed]
- 3 Slashes appear after Apostrophe in custom fields after updating product-site
- Trying to retrieve post meta
- Need help enqueueing webfonts
- Error call_user_func_array() expects parameter 1 to be a valid callback when using image_size_names_choose
- Is it possible to return content, and then also continue to do other things?
- How to remove ?p= from wordpress short links
- Need php code’s output to display underneath a Divi Module
- WP_Query | IF within $args array | Help me only add specific arguments if the argument is not blank
- How to make function appear in sentence?
- How to define a variable already defined in a plugin function?
- woocommerce specific quantities for product
- How to use mysql LIKE with wpdb?
- woocommerce related product title length
- Custom query vars filters problem with pagination
- Query for user roles
- Use SCSSPHP to compile Theme Customizer Values into .SCSS files ready to compile to CSS
- Must filter functions receive all arguments passed to them?
- Displaying Event within two given time frames
- Displaying Slider in Front Page (home) using Customizr Theme
- How to call custom function outside from the admin page?
- Is there a way to create a “copy post” link?
- Taxonomy term description with style, only if the description exists?
- Use of antispambot with $curauth->email
- Restrict post to current user in postmeta
- copy fields value to another field
- posts_per_page displays only 2 posts instead of 4 posts
- Get parent category name when only child category is applied to a product
- Can an AJAX callback function access a PHP variable which was defined during initial page load?
- Adding product permalink on admin order page throwing error
- Before & After Content – After Content directly below Before Content when using require_once
- How to override WooCommerce Order Item Meta with data from Cart?
- Taxonomy Child Term, Counter is staying on 0
- Access to “My Site” is missing from the admin bar
- How to redirect (301) trashed post to it’s parent taxonomy TERM ARCHIVE instead of 404 page
- How to call WordPress PHP file using external js file
- Using get_theme_mod with checkbox to display content
- use system script advertising in wordpress multisite
- Styling admin page rows in order of importance (checkboxes)
- Help with my first Metabox helper class
- Break a WordPress function to run in patches and re-continue
- Pagenav Not appearing on custom Template
- ISOTOPE – Missing/Invalid Arguement Get Terms
- My title is showing after the shortcode
- Load a Header in wordpress
- Trouble figuring out how to get my button to submit comment
- Setting WooCommerce currency programmatically
- Adding multiple conditional tags in a function?
- Generate and upload screenshot as featured image for user-submitted post
- a problem in class in class-wp-hook.php
- change title of page dynamically