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
March 19th, 2008 at 6:24 pm
i mean
? php the_tags () ;
Guest
March 19th, 2008 at 6:24 pm
Hi great plugin, but how to correct or use fixes for
Guest
March 14th, 2008 at 10:22 am
This is great
Guest
March 14th, 2008 at 10:21 am
Thank you very much for your work.
Guest
March 14th, 2008 at 10:21 am
this is fabolous thank you.
Guest
March 13th, 2008 at 3:40 am
Thanks for the quick reply! I tried that and it didn’t work for me. It didn’t break anything, just didn’t do the rewrite, and simply returned the 404 page. By the way, I’m assuming you meant “tdo_tag” not “td_cat”. I tried both anyway.
But I did find this in the Codex:
http://codex.wordpress.org/Custom_Queries#Permalinks_for_Custom_Archives
It seems like what I’m after, but not sure where something like that would go (obiously changing the function names etc). I’m thinking the most obvious place is in your plugin somewhere (duh!).
I tried adding a suitably edited version of the above sample just to the end of your plugin, but that didn’t work either (not that I expected it to).
(There’s also http://codex.wordpress.org/Function_Reference/WP_Rewrite).
I think we’re getting closer.
I also had a look at the Search Permalink plugin:
http://wordpress.org/extend/plugins/search-permalink/#post-2433
I think a rejig of that might work also…
I’m playing around with a few ideas and if anything work, I’ll let you know.
cheers and thanks again,
Michelle (The Boss)
Administrator
March 12th, 2008 at 1:09 pm
I’m sure there is a nice wordpress way, probably hooking into wp_rewrite stuff… but also I think you can do it with .htaccess easily enough.
If you stick something like this at the top of your .htaccess
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^fun/(.*)$ ?td_cat=$1 [L]
</IfModule>
It should allow a url like “http://your-blog-uri/category/mycategory/fun/tag1+tag2″ to act like “http://your-blog-uri/category/mycategory/?td_cat=tag1+tag2″.
I’ve tested this piece of code below and it will redirect “/fun/tag1+tag2/” to “?td_cat=tag1+tag2″.
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^fun/(.*)$ ?td_cat=$1 [L,R]
</IfModule>
But this isn’t exactly what you want. Dropping the R should do the trick though.
Guest
March 12th, 2008 at 11:09 am
Hi, Your plugin is solving a major problem I had. Thanks. But I had a question about URL structure. Instead of having it output the URL as:
“http://your-blog-uri/category/mycategory/?tdo_tag=tag1+tag2″
Could it output as:
“http://your-blog-uri/category/mycategory/tdo_tag/tag1+tag2″
??
In this way, I can change the “tdo-tag” bit to a general keyword for my niche (for example, I have a games site, so a generic word like “fun” or “play” would be appropriate). Then I’d have SEO-friendly (and human-friendly) URLs for these intersections (I’d like them to be links in my menus).
So the desired URL might be:
“http://my-blog-uri/category/puzzles/fun/adventure″
where “puzzles” is the category and “adventure” is the tag that I want to produce an interaction of.
And similarly,
“http://my-blog-uri/category/puzzles/fun/adventure+kids″
would be the intersection of the category “puzzles” with the tag “adventure” AND “kids”.
(For the record, for SEO, I’m also renaming the category and tag bases to more relevant keywords).
I’m happy to fiddle the .htaccess if that’s required (but am having difficulty doing so). I just don’t know enough php or javascript to hack your wonderful plugin
Thanking you heaps and heaps in advance,
The Boss
March 7th, 2008 at 8:33 pm
[...] inceliyordum ve bu eklentiden haberim oldu sayesinde. Kendisine teşekkürler Gelelim eklentiye, TDO Tag Fixes Eklentisi Wordpress için mükemmel bir seo eklentisidir. Özelliğine gelince, mesela blogunuzda [...]
February 23rd, 2008 at 8:59 am
[...] Visit [...]