I'm trying to assign a little image icon to a post to represent the category it's in, rather than using the category name. I figured the best way to do this would be to include the slug name in the filename of the image and call the slug in dynamically in category.php:
<img class="valign-middle" src="images/icon-<?php get_category_by_slug( $slug ) ?>-small.png" />
However, in Firebug all it's showing is icon--small.png.
Can anyone please explain to me where I'm going wrong? I've tried searching through the other related threads for this but most of them seem outdated or slightly different to what I'm after.