« The Squirrel Factor
» Wordpress: Show Combined Categories

Wordpress: Finding the Tag Ids

In a bilingual blog based in Wordpress, knowing the tag Id’s is useful to filter the tag cloud so it only includes a specific set of tags. For version 2.3.3, there isn’t any admin page to check them, so they must be found manually.

Since, once I’ve got my tag clouds filtered, I’ll need very rarely to check the Id’s —to add a new tag to the list—, I went with a quick and dirty solution:

$posttags = get_the_tags();
if ($posttags) {
echo '<!-- Tag Ids: ';
foreach($posttags as $tag) { echo $tag->term_id . ' '; }
echo ' -->';
}

Adding this in single.php before or after the tag line allows me to read the Id’s just by selecting and viewing the source code of the selection (I use Firefox). Then I can add the numbers to wp_tag_cloud with ‘include=542,543,…’.

1 Reply

have your say

Add your reply or subscribe to this discussion.

:

:


« The Squirrel Factor
» Wordpress: Show Combined Categories