• Resolved Steve

    (@steveconley)


    Hi. I’m trying to display the various, unique “Thumbnails” for terms within a Pods-generated custom Taxonomy.

    The permalink and name are looping fine but I can’t seem to crack what the magic tag might be to directly display the term’s thumbnail or insert the URL of a term’s thumbnail. (I’ve searched these forums and googled the wider web with no luck. I truly apologize if I’m missing something obvious.)

    <ul class="award-logo-icons">
    [each awards_won]
    <li><img src="[I WANT EACH TERM'S INDIVIDUAL IMAGE TO APPEAR HERE]"><br>
    <a href="{@permalink,esc_url}">{@name}</a></li>
    [/each]
    </ul>

    Thanks for your time. — Steve

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter Steve

    (@steveconley)

    My low-tech, suboptimal interim solution is to use unique Thumbnails with the Term’s slug as the file names.

    For example, if the Term’s slug is “most-improved-bowler” then the image name is “most-improved-bowler.png”

    It looks a bit like this:

    [each awards_won]
    <li><a href="{@permalink,esc_url}"><img src="https://DOMAIN/wp-content/uploads/2021/06/{@slug}.png" alt="{@name}">
    	<br><b>WINNER</b><br>{@name}</a></li>
    [/each]

    It’s suboptimal because some of the awards would use the same graphic and so the same graphic (duplicated and given unique names) is loaded multiple times.

    But it works.

    If a cleaner solutions exists, I’d love to know. Thanks again for a great plug-in! — Steve

    Plugin Author Jory Hogeveen

    (@keraweb)

    Hi @steveconley

    If a term has an image then it has an image field. You can get the image using the following magic tags:

    {@image_field_name} (full image)
    {@image_field_name._url} (url only)

    More info here: https://docs.pods.io/displaying-pods/magic-tags/using-magic-tags/

    Cheers, Jory

    Thread Starter Steve

    (@steveconley)

    Hi @keraweb!

    I think we’re talking about two different things but your answer helps.

    I was looking to leverage the term’s baked-in “Thumbnail” feature.

    I think your answer goes around that by (if I read it correctly) suggesting I add an File Image/Video Field to my custom taxonomy. So I did that, attached an image for each term that way, and then called them with the magic tag.

    That works.

    I created a new File/Image/Video Field for my taxonomy named “award_logo_icon

    And the final template bit looks like this…

    [each awards_won]
    <li><a href="{@permalink,esc_url}"><img src="{@award_logo_icon}" alt="{@name}">
    	<b>WINNER</b><br>{@name}</a></li>
    [/each]

    I’d share the results here but the site is still under construction. Thanks for your speedy help! — Steve

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Displaying custom taxonomy term thumbnails using a Pods template?’ is closed to new replies.