Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Update: I'm now trying to find a way to echo the metadata of a custom taxonomy's value.

I'm trying to create some PHP to use in a plaintext widget that'll display information in my sidebar. Because some of the information will be identical across some of the parts of the site instead of storing the information in custom fields I'm trying to store it in a MYSQL table. What I'd like the code to do is to identify the post taxonomy, lookup the id field in my table, find the row with that shares the id with the taxonomy and then echo the values of other fields on that row.

I have my taxonomy setup as well as my table but I can't find much of a precedent for this and therefore I'm struggling to know where to start.

So far I'm trying to call the current post taxonomy's value but I can't get it to work outside the loop

<?php
$current_tax = get_query_var('game');
echo $current_tax;
?>
share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

First of all, what you're calling $current_tax would more appropriately be named $current_term. The taxonomy is 'game'.

Secondly, what you're trying to do is basically adding term metadata. There already are several plugins that provide the custom table and functions for that.

I recommend Simple Term Meta.

share|improve this answer
    
Hi, do you know of any plugin that adds a GUI with the metadata functionality? –  Co-Op Reviews Mar 12 '11 at 3:07
    
Can't say that I do. –  scribu Mar 12 '11 at 3:10
    
I found one Ultimate Taxonomy Manager –  Co-Op Reviews Mar 12 '11 at 12:27
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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