Set default featured image for terms of a custom taxonomy

I want to set a default featured image for terms of a custom taxonomy.

I found this code but it is only good for categories and not for other terms:

Read More
<?php if (  (function_exists('has_post_thumbnail')) && (has_post_thumbnail())) : ?>

<?php the_post_thumbnail('thumbnail'); ?>

<?php else :?>

<img src="whatever/directory/<?php $category = get_the_category(); echo $category[0]->cat_name; ?>.jpg" /> 

<?php endif;?>

How can I make this code also work for a custom taxonomy?

Related posts

Leave a Reply

1 comment