Thanks for this.
Not quite sure I am getting it.
What does this line exactly do?
<div class=”<?php foreach((get_the_category()) as $cat) { echo $cat->cat_name . ‘ ‘; } ?>”>
And how do I set up the CSS? How will it recognise that its 1, 2 or 3 categories and change the width of the overlay?
Thanks.