0

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?

1 Answer 1

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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