Customize tag cloud per post

Posted in: Newspaper
Post count: 2

Hello,

I am trying to customize my tag cloud so that it only displays the tags for that post per post.
example: Post 2b tag cloud only showing tags that were added to Post 2b and not the entire site.

I’m just using the default tag cloud not another plugin.

I found this code from 2012 but not sure if it would still work today.
And if it can work, where would I insert it?

Thanks

<?php
// Get the assigned tag_id
$tag_ids = wp_get_post_tags( $post->ID, array( ‘fields’ => ‘ids’ ) );

// Check if there is any tag_ids, if print wp_tag_cloud
if ( $tag_ids ) {

wp_tag_cloud( array(
‘unit’ => ‘px’, // font sizing choice (pt, em, px, etc)
‘include’ => $tag_ids, // ID’s of tags to include, displays none except these
) );
}
?>

Post count: 22421

Hello,

The tags in our theme posts only show the tag added to that specific post. I;m not sure what you are referring to. Please provide more details.

Thanks

Viewing 2 posts - 1 through 2 (of 2 total)
The forum ‘Newspaper’ is closed to new topics and replies.