0

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?

1 Answer 1

3

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.

5
  • The problem with that plugin is that it wont display the image on index.php
    – Dan Lee
    May 4, 2012 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, 2012 at 17:22
  • I have updated my question. What snippet do you use?
    – Dan Lee
    May 7, 2012 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, 2012 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, 2012 at 10:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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