Lost tag cloud customization in last update
-
Hello!
I seemed to have lost my check mark that would appear on highlighted tags in the last update.
Any idea what might have happened?
Here’s the filter I was using:
/*
* Highlight clicked tag in tag cloud
*/add_filter ( ‘wp_tag_cloud’, ‘tag_cloud_current_tag_highlight’ );
function tag_cloud_current_tag_highlight( $return ) {
$post_tags = array();
if(is_single()) {
global $post;
$post_tags = get_the_terms($post->ID,’post_tag’);
}
if(is_tag()) {
$tags = explode( ‘+’, get_query_var(‘tag’) );
foreach( $tags as $tag ) { $post_tags[] = get_term_by(‘slug’,$tag,’post_tag’); }
}
if( $post_tags ) {
foreach ($post_tags as $pt) {
$tag = $pt->term_id;
if(preg_match(“#-link-” . $tag . “‘ #”, $return)) {
$return = str_replace(“link-” . $tag . “‘ “, “link-” . $tag . ” current-tag’ “, $return);
}
}
}
return $return;
}Along with the following CSS:
.current-tag:after {
content: “”;
display: inline-block;
background: url(“https://thenourishedcook.com/wp-content/uploads/2014/11/Checkmark.png”) no-repeat top right;
width: 22px;
height: 20px;
padding-left: 5px;
}Thanks in advance for your help!
Sharon
thenourishedcook.com
- The topic ‘Lost tag cloud customization in last update’ is closed to new replies.