Echo Category Nicename
*get_the_category();* is designed to return multiple categories. You have to provide index for deciding which categories’ nicename you want to echo. Something like below, $category = get_the_category(); echo ‘<img src=”‘.get_bloginfo(‘template_directory’).’/images/categories/’.$category[0]->category_nicename.’.png”>’;