I'm trying to make a change to my index.php page where each post displayed by the loop shows a different image depending on category. I can't seem to find it anywhere, or maybe it is too complicated for me to grasp.
I've named my images the same way as category slugs (example: video.png, music.png, text.png for respectively video, music and text categories).
Here is my code so far (I miss the php segment that will return the category slug):
<img src="<?php echo get_template_directory_uri(); ?>/img/<?php ... ?>.png" />
So, I tried to read the codex and found solutions for single posts, but I can't seem to make if work on my index.php file. Any suggestions please?