How to add a posts tags cloud to end of posts

level Beginner

How to add a posts tags cloud to end of posts
level Beginner

An alternative way of showing related content in your posts is to include a TAG CLOUD at the end of your article. You can create this with an easy shortcode function that will identify the post ID, get the post’s tags and then display the tags as a tag cloud.

Simply add the following shortcode code to your functions.php file, then add the shortcode [dtposts-tagcloud] in your posts where you would like the tag cloud to display.

This uses the standard wp_tag_cloud() function as explained in the WordPress Codex.

This shortcode is demonstrated below. I have added a heading, some css styling, and then called the function using the shortcode. The code is entered as text in the text editor in a WordPress post: