<?php $tags = get_the_tags($post_id); ?>
Here $post_id
is the ID of the post of which you want to get tags. This is same parameter as passed to get_post()
. When used inside the loop $post_id is optional & default to the current post.
<?php $tags = get_the_tags($post_id); ?>
Here $post_id
is the ID of the post of which you want to get tags. This is same parameter as passed to get_post()
. When used inside the loop $post_id is optional & default to the current post.