I have a featured image. I want to add an if statement to the size. For example, if the featured image height exceeds 500px I want to add something.

Is that possible ?

  • 2
    What have you tried? Please edit your question to include your current code. – Chip Bennett Nov 6 '13 at 23:48
  • @ChipBennett I still didn't try. I want to know if this is possible. I am willing to have posts that are like boxes. If one of the posts have a higher featured image height i want to make it a full width post – Faisal Nov 6 '13 at 23:59
  • 1
    Without seeing your actual code, it's nearly impossible to know exactly what you're trying to accomplish, and where you're having issues. – Chip Bennett Nov 7 '13 at 0:14
  • To give a little context: the reason that the question can't be answered in its current form is because that, when calling the_post_thumbnail(), the return is an image of a known, specific size. You might want to have a look at wp_get_attachment_metadata() as a starting point. – Chip Bennett Nov 7 '13 at 0:17
  • 1
    Please file an edit and add your code (and any possible progress) to the question. – kaiser Nov 7 '13 at 8:17

instead of a lot of code you have 2 ways to achieve your goal

1-use timthumb

2- specifying height & width to your the_post_thumbnail()

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.