Downloads: TDO Tag Fixes Wordpress Plugin (0.5)
Some fixes and extensions for Wordpress tags such as a tag cloud using only tags found in a specific category and also tag and category intersection.
Download Plugin Now from Wordpress.org!
Version 0.5 enables true ‘or’ tag intersection when using a category. It wasn’t working prior to this (and no-one noticed). Thanks to Joel Giddey for spotting it.
Wordpress 2.3 introduced native tagging support, which is rather nifty.
But did you know that you can display multiple tags in the one archive and even generate a feed for that?
- “http://your-blog-uri/?tag=tag1,tag2” this would get all the posts tagged with tag1 or tag2.
- “http://your-blog-uri/?tag=tag1+tag2” this would get all the posts tagged with tag1 and tag2
- “http://your-blog-uri/?tag=tag1,tag2&feed=rss” this would get you an RSS feed for all the posts tagged with tag1 or tag2
Neat huh? But did you notice that on the generated tag page you see only one tag listed in the header? This function fixes that and displays all tags used to generate that tag archive. It does this by silently modifying the single_tag_title template tag. It’ll even work on the RSS feed generated by that page!
What would be also be cool is to be able to intersect categories and tags so you could grab posts with tags from a specific category for example?
With this plugin you can. It’s not perfect however. It only allows intersection between a single category and one or more tags. Technically Wordpress should be able to support multiple categories and tags intersections but it didn’t work for me in Wordpress 2.3.x and 2.5.
So go to one of your category pages. If your using using fancy permalinks then at the end of the url add “?tdo_tag=a_tag“. If your not using permalinks then you can just use “&tdo_tag=a_tag“. You must use the tag slug, not the full tag name. You can use multiple tags as above using “,” and “+”.
- Example not using fancy permalinks: “http://your-blog-uri/?cat=35&tdo_tag=tag1,tag2” this would get all posts in category with id 35 and tagged with either tag1 or tag2.
- Example using fancy permalinks: “http://your-blog-uri/category/mycategory/?tdo_tag=tag1+tag2” this would get all posts in the category “mycategory” and tagged with both tag1 and tag2.
This plugin uses this intersection code to automatically modify the built-in tag cloud template tag wp_tag_cloud so that if it is used on a category archive, it shows only the tags within that category. You can then click on a tag in that tag cloud and it will get the posts for in that category that tagged with that tag. (You can disable this and just use the specific template as you need).
Guest
April 5th, 2008 at 10:59 am
Hi admin, yes exactly.
Administrator
April 4th, 2008 at 4:14 pm
I’m about to release an new version of tdo-tag-fixes. I’ve tested it on WP2.5, done some fixes to the tag cloud (as requested), added a tdotf_the_tags (to replace the_tags template tag) (as requested) and add some basic fancy permalink stuff (as requested).
Administrator
April 4th, 2008 at 2:14 pm
Hi toto - you want to get the id of the category on a post that is the parent of the other categories on the post?
Guest
April 3rd, 2008 at 7:12 pm
Help again.
my custom function is
function tagger() {
$posttags = get_the_tags('');
if ($posttags) {
$num = count($posttags);
foreach((get_the_category()) as $category[0]) {
$cnt = 0;
foreach($posttags as $tag) {
$cnt++;
echo ‘ cat_ID . ‘&tdo_tag=’ . $tag->slug . ‘” title=”This is single post ‘.$category->name . ‘, ‘ . $tag->name . ‘”>’ . $tag->name . ‘‘ ;
if($cnt < $num) {
echo “,”;
}
}
}
}
}
it works like
How can i limit category only to parent.
For example i have a post listen in Cat1 and subcat
I want to see tags only for parent Cat1.
May be should use
$category[0]?PLS help.
Guest
April 2nd, 2008 at 11:35 pm
thanks
Administrator
April 2nd, 2008 at 4:15 pm
I just did a quick look at the code, the code that grabs the tags from posts in a specific category does not exclude tags listed in the exclude tag list. In fact it does no modification on the tag list. So number/include/exclude etc. are ignored. orderby isn’t though (however ‘rand’ is not support). Would this explain your issue? If so I can attempt to fix it.
As for getting the plugin to work with query_posts… I’d nearly recommend ditching the plugin and using the code for your own work (this was the original intention for the plugin - some example code). The plugin does overwrite the query object so if you try to modify the query object, it’s effect may depend on if it modifies it before the plugin activates or after.
Guest
April 1st, 2008 at 9:32 pm
Mr. Deceased Individual,
I’m using WP 2.3.2 … I’m getting a very short list of tags back using your plugin, 11, I have it set to 0, I have tried something small like 20 as well.
When they are both activated sensitive tag cloud gives me the same short list of tags… If I disable tdo tag fixes… sensitive tag cloud returns a big list…
If I have them both active, sensitive tag cloud returns the same trunkated list…
I’m trying both of these:
wp_tag_cloud(’smallest=8&largest=8&unit=pt&number=0&format=flat&orderby=name&order=ASC&exclude=560,562′);
The excluded tags are not getting excluded…
Guest
April 1st, 2008 at 8:04 pm
Double drat! All of a sudden tdotf_cat_tag_cloud, and wp_tag_cloud are only returning 11 tags… no matter what I do…
March 31st, 2008 at 8:37 pm
[...] TheDeadOne.net on Tags and Categories Posted March 31, 2008 Software: TDO Tag Fixes Wordpress Plugin [...]
Guest
March 28th, 2008 at 8:22 pm
?keyword=bunnies&orderby=title&order=asc
is not to handy for generating URL’s,
&orderby=title&order=asc?keyword=bunnies
also works
Now if I can just figure out how to create and retrieve groups of tags (States) (Rodents)rats, bunnyies, gophers (Felines) lions, tigers, panthers… I will be styling.