Function for Wordpress themes:
Develop a function that shows tags related to a certain tag.
What do I mean by 'related tags'?
Related tags are tags that are used by the same posts.
I wish to use the function on the tag-archive page. It should do the following:
- get single_tag_id
- check which posts use this specific tag
- check which other tags are used by these posts
- return the mostly related tags
- 1. fallback (if there are equally related tags): chose the tags with the highest number of posts
- 2. fallback (if equally related tags with equal number of posts): either alphabetical or random
- return nothing, if there are no related tags
- return as many related tags, as there are, maximum 7
- return the tags in alphabetic order, separated by commas