Responsive Images Let WordPress do the hard work

The code

Find the following code (or something like it) in page.php or post.php:

<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<h1><?php the_title(); ?></h1>

Insert code here

<section>

 

 

Code to insert:

<?php
   if (is_mobile()) {
   the_post_thumbnail('medium');
   } else {
   the_post_thumbnail('large');
} ?>