• I don’t know if I’m being thick or not, but all I want to do is grab the image associated with a category.

    So I am using get_categories to loop through categories and I’d like to be able to get the image associated with the current category as it loops through (if that makes sense).

    Is there a simple, or indeed complex way to do this?

    http://wordpress.org/plugins/taxonomy-images/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hey Peepfunk check this out

    hope it may help you it works perfectly for category

    <img src="<?php foreach((get_the_category()) as $category) $term_id = $category->cat_ID; $image = get_option( 'taxonomy_image_' . $term_id ); echo $image; ?>" alt="<?php $category = get_the_category(); echo $category[0]->cat_name; ?>" />

    How ever if you find a way to display the subcategory do let me know 🙂

    Cheers

    Anonymous User 13090675

    (@anonymized-13090675)

    @mandipluitel: can that also in tags? What is code for the first tag from my post as featured image please? thankx you!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Get image associated with specific category’ is closed to new replies.