Forum Moderators: open

Message Too Old, No Replies

Separate sets of tags in Wordpress

what if all the tags shouldn't be mixed together?

         

kristof234

4:40 am on Jan 8, 2009 (gmt 0)

10+ Year Member



Does anyone know if there is a method in Wordpress (a plugin or something) that can create multiple sets of tags for posts?

Say, for example, I write a blog about movies. I would like to have tags to describe the genre, stars, director, etc.

They should look like this:

--------------------------------
Genre: Action, Adventure, Western
Starring: Eli Wallach, Clint Eastwood, Lee Van Cleef
Directed by : Sergio Leone
--------------------------------

But all I can get in Wordpress is something like this:

--------------------------------
Tags: Action, Adventure, Clint Eastwood, Eli Wallach, Lee Van Cleef, Sergio Leone, Western
--------------------------------

So I need something that can either create multiple sets of tags or allow me to organize tags into groups and then present them separately on the page.

Thanks for your thoughts!

brotherhood of LAN

9:45 pm on Jan 13, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



<bump>

Unfortunately no one could answer in New to Web Dev...hopefully the chaps here who are more attuned to Wordpress can offer some guidance.

londrum

9:57 pm on Jan 13, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



hi. it's half do-able with "custom fields".

when you are writing your new post, just make a new custom field in the box which appears,
eg. in the 'name' box write "Genre", or whatever you want,
and then write "Action, Adventure, Western" in the value box.

then you will have to amend your single.php template.

where you want the value ("Action, Adventure, Western") to appear, put this...

<?php

$example_name = get_post_meta($post->ID, 'Genre', true);

if($example_name) { echo 'Genre: '.$example_name; }

?>

but if you want those words to be linked to the tags, then the only way i can think of doing it would be to check each word against the table in your database. but there is probably an easier way

Marcia

10:03 pm on Jan 13, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



In the absence of a plug-in, you'd have to modify the template using some kind of conditional code, and devise some sort of "trigger" to set the condition.

Here's a start in the direction, from the WP Codex:

Conditional Tags [codex.wordpress.org]

Added:

I hit submit before seeing the previous post, but would it be possible to use a custom field to specify a genre, and then use a conditional tag using the genre for categorizing the tags?

For example, if the genre could be fruit or vegetables, could a conditional tag set to one or the other as the condition, in order to get

Fruit: apples,oranges,pineapple
Vegetables: beans,peas,potatoes

[edited by: Marcia at 10:15 pm (utc) on Jan. 13, 2009]

ergophobe

10:51 pm on Jan 13, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



How committed are you to Wordpress?

I ask because Drupal allows you to create multiple "vocabularies". So you would create a vocab for each set of tags (genre, stars, directors). The underlying data and mechanism for adding that data is built in, the tags would be clickable and those tags would bring the user to pages with the same tags. If you had AJAX allowed and whatnot, it should even suggest tags as you type (often slow).

You would still need to figure out how to then put them in the template as you want. By default it would display them all in one "cloud" or whatever you want to call it, so you would need to figure out for drupal a template solution like londrum's for WP.