If I have a CPT "movies" I know I can have various taxonomies eg "Director", but how can I store further information such as "director's nationality" for any one particular director ... or is this possible using WordPress?


why don't you take a look at this I think it it is what you are looking for

  • Actually I found a solution to my problem using the advanced custom fields plugin but I will accept this as it seems a pretty good link. – byronyasgur May 23 '13 at 20:29

The taxonomy system doesn't have any meta_data feature. Without constructing another table, your option seems to me to be to store the taxonomy information in the $wpdb->options table using the appropriate functions.

Honestly, I can't help but think that you are trying to use the taxonomy system for something beyond what it was meant for and that you should be considering post meta or a custom post type.

Or, you should be using multiple taxonomines-- one for directory, one for the director's nationality, etc.

I would say to use the multiple taxonomies, or create your own table to hold the taxonomy meta. I worry about performance though. The taxonomy queries are complicated.

  • Thanks - no I'd be using a Custom Post Type alright. I only gave the example of taxonomy for somewhere to start. I would go with any solution, eg post meta etc but I cant imagine it working with post meta either ( because there could be more than one director per film and you cant just keep adding custom meta like that ). Really what I'm trying to establish is whether there is ANY way of storing that type of data in WordPress – byronyasgur May 23 '13 at 15:06
  • "you cant just keep adding custom meta like that"-- yes you can, but whether it is a good idea depends on how you want to use (query) the data. It isn't the CPT I am worried about, it is the custom taxonomy. – s_ha_dum May 23 '13 at 15:13
  • "you cant just keep adding custom meta like that"-- yes you can ... I'm fuzzy on this ... I thought that you programmed each piece of postmeta individually, so that if you set it so there were 3 slots for directors on the movie, then it would be limited to that, unless you reprogram it. As opposed to a taxonomy where the user can keep entering ( for instance tags, as many as they like ) Am I wrong about this? – byronyasgur May 23 '13 at 15:46
  • Your code obviously has to support entering multiple values for the same key, but that is easily done. The default custom meta form uses Javascript to add field after field, for example. – s_ha_dum May 23 '13 at 15:49
  • actually it's been a while since I looked at the way wordpress does that - I don't think it used javascript like that last time I looked at it, thanks for pointing that out to me. As I said above I found I was able to get what I wanted using the advanced custom fields plugin – byronyasgur May 23 '13 at 20:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.