Display tags coming from a category
-
Hello All,
I read this topic (http://wordpress.org/support/topic/get-tags-specific-to-category) about to get the tags specific to a category.
I am almost there but cannot figure out how to dynamically get the category ID when you are on the page as opposed to have to specify the category IDs when you call the function which actually means that you get all the tags from all the specified categories – I have italicized and bolded up in the snippet below where you have to specify the category IDs.
<?php
// Category tag function$args = array(
‘categories’ => ‘5,13,14’
);
$tags = get_category_tags($args);
$content .= “<div>”;
foreach ($tags as $tag) {
$content .= “<span>tag_link\”>$tag->tag_name</span>”;
}
$content .= “</div>”;
echo $content;
?>Thank you for your help!
P
- The topic ‘Display tags coming from a category’ is closed to new replies.