views:

30

answers:

1

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?

+1  A: 

Try in_category("foo", $post->post_parent)

Richard M
thanks! worked like a charm!
reggie