• Resolved x111

    (@x111)


    I’m trying to get a different size image to show up in image.php depending on the category it’s in but it’s not working. Upon closer inspection it turns out that even the_category() doesn’t work and simply outputs the default category instead of the relevant one.
    Is there any way to get the category to show up in any image.php?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Images aren’t filed under categories. Only posts are. So you’d need grab the category for the image’s parent post using $post->post_parent.

    Thread Starter x111

    (@x111)

    You just made my day. Thank you very much.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Categories not working in image.php’ is closed to new replies.