As of WordPress Version 2.3 the wp_tag_cloud() function is available to developers which will display a list of tags, where the size of each tag is determined by how many times that particular tag has been assigned. The default title text for tag cloud links has the following format ‘%s topic’, ‘%s topics’ (where %s is the number of times the tag has been assigned).
Tag cloud with default title.
Custom WordPress Tag Cloud
Thanks to the taxonomy parameter this function can also be used for custom taxonomies. Let’s say you built your custom taxonomy (i.e. sports) and would like to display a tag cloud where the title for the sports tags is athlete(s). The function parameter topic_count_text_callback will allow you to override the default title tag function in WordPress.
For this to work, you will need to define a custom function in your theme’s functions.php file and then use it with the topic_count_text_callback parameter in the wp_tag_cloud() function. Here’s the code for our sports tag function.