Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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
add comment

1 Answer 1

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
add comment

Your Answer

 
discard

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.