I am displaying the featured image for all my posts on one page (the image then links to the individual post). I want to give each post from the same category the same class (which will be the name of the category slug), so for example, if a post is in a category called "cat1" I would like the div that contains the post to have the class "cat1" and so on.
So far I have this:
<article class="<?php get_the_category($post->ID)?>">
but this just returns blank, can someone tell me what I'm missing here please.