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.

How do I add and display an image for a taxonomy term in any template? I am using the plugin Taxonomy Images but I can find the right code snippet that will display the image in all template files.

I'm trying to do fetch an image for a single term on index.php, archive.php and taxonomy-term.php. Each page contains a loop of posts and I want to display the taxonomy term image for each post filed under a taxonomy term. Is that clearer?

share|improve this question
add comment

1 Answer

If you don't use a plugin, then you'll essentially have to write your own which strikes me as counter-productive. I would recommend using a plugin and figuring out how to make it work.

I've used mfields' Taxonomy Images to great effect. The way you access the image is certainly a little funky in some situations, but it works. There are some good code snippets in the WordPress.org support forum for that plugin in addition to what is provided on the Plugin page.

share|improve this answer
    
The problem with that plugin is that it wont display the image on index.php –  Dan Lee May 4 '12 at 13:20
    
"It won't display the image on index.php?" It sounds like you haven't found the write code snippet yet. Can you maybe update your question to ask about that specific problem? Like I said, I've had good luck with that plugin, even if it's a little frustrating at times. –  mrwweb May 4 '12 at 17:22
    
I have updated my question. What snippet do you use? –  Dan Lee May 7 '12 at 11:51
    
That completely depends on what you're trying to do (single term? many terms? terms assigned to a post?). Include the code you're trying to use, a description of EXACTLY what you're trying to do, and any progress you have made (even if it's not what you want yet). –  mrwweb May 7 '12 at 16:28
    
I'm trying to do fetch an image for a single term on index.php, archive.php and taxonomy.php. Each page contains a loop of posts and I want to display the taxonomy term image for each post filed under a taxonomy term. Is that clearer? –  Dan Lee May 19 '12 at 10:04
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.