Title: wp_tag_cloud Possible Bug
Last modified: August 19, 2016

---

# wp_tag_cloud Possible Bug

 *  [xomero](https://wordpress.org/support/users/xomero/)
 * (@xomero)
 * [15 years, 10 months ago](https://wordpress.org/support/topic/wp_tag_cloud-possible-bug/)
 * When I try to add a filter to wp_tag_cloud for use this function in the default
   widget, an error ocurrs:
 * I’m doing this in my functions.php file in my current template:
 *     ```
       function tag_cloud_template($args) {
       	$args['number'] = 15;
       	$args['format'] = 'list';
       	return $args;
       }
       add_filter('wp_tag_cloud','tag_cloud_template');
       ```
   
 * Then I get this on the frontend AND in the backend in the “edit-tags.php?taxonomy
   =post_tag” page.
 * `1a href='http://MYSITE/wp-admin/edit-tags.php?action=edit&taxonomy=post_tag&
   post_type=post&tag_ID=16' class='tag-link-16' title='1 topic' style='font-size:
   8pt;'>B&B`
 * B&B is the first tag, there is a number “1” instead the “<” in the “<a” tag. 
   The second tag it comes fine:
 *     ```
       1a href='http://MYSITE/wp-admin/edit-tags.php?action=edit&taxonomy=post_tag&post_type=post&tag_ID=16' class='tag-link-16' title='1 topic' style='font-size: 8pt;'>B&B</a>
       <a href='http://MYSITE/wp-admin/edit-tags.php?action=edit&taxonomy=post_tag&post_type=post&tag_ID=29' class='tag-link-29' title='1 topic' style='font-size: 8pt;'>beautiful views</a>
       <a href='http://MYSITE/wp-admin/edit-tags.php?action=edit&taxonomy=post_tag&post_type=post&tag_ID=6' class='tag-link-6' title='5 topics' style='font-size: 15.466666666667pt;'>Bed and Breakfast</a>
       ```
   
 * If I remove the add_filter in the functions.php the error just gone.
 * If I try to use a separator like this:
 *     ```
       function tag_cloud_template($args) {
       	$args['separator'] = '-';
       	return $args;
       }
       add_filter('wp_tag_cloud','tag_cloud_template');
       ```
   
 * then the output in the frontend and the backend is:
    `-a href='http://MYSITE/
   wp-admin/edit-tags.php?action=edit&taxonomy=post_tag&post_type=post&tag_ID=16'
   class='tag-link-16' title='1 topic' style='font-size: 8pt;'>B&B`
 * so, maybe the error is in the separator filter, but the error occurs even if 
   I dont’ use the separator arg.

The topic ‘wp_tag_cloud Possible Bug’ is closed to new replies.

 * 0 replies
 * 1 participant
 * Last reply from: [xomero](https://wordpress.org/support/users/xomero/)
 * Last activity: [15 years, 10 months ago](https://wordpress.org/support/topic/wp_tag_cloud-possible-bug/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
