WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've got a small challenge, right now I have an existing blog with images that formatted for desktop. I have a mobile child theme that shows the content for mobile.

Is there a method to filter a different version of an image when the post displays?

More succintly, could I force all images to show their 'medium' versions on the mobile child theme and the full version on the desktop version?

share|improve this question

If you want to detect the browser in PHP, there are plugins like PHP Browser Detection that will provide conditionals that will allow you to do that. Then depending if the browser is desktop or mobile, you can grab the images with the specific size you want with wp_get_attachment_image

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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