How do I check the category on the image.php theme file in Wordpress? I tried in_category('categoryname') but it did not work. I want to use it outside of the loop. (Btw, the function also did not work inside of the loop...) I need this to show banners according to the categories of the post.
I guess the problem is that the attachment is not associated with the category of the post?