title: get medium size instead of full
body: <p>I am struggling to get the medium Size for an URL to an Image in Wordpress. My working source looks like this:</p>
  
  <pre><code>&lt;div class="entry-thumbnail coverback" style="background-image: url(&lt;?php echo wp_get_attachment_url( get_post_thumbnail_id() ); ?&gt;); "&gt;
  </code></pre>
  
  <p>but that calls for the full image and by that my Page explodes to 9-10 MB per load as the uploaded full images are a bit bigger.</p>
  
  <p>So I have Tried so far without success:</p>
  
  <pre><code>&lt;div class="entry-thumbnail coverback" style="background-image: url(&lt;?php echo $image_attr = wp_get_attachment_image_src(get_post_thumbnail_id($post-&gt;ID), 'medium');  ?&gt;); "&gt;
  </code></pre>
  
  <p>and</p>
  
  <pre><code>&lt;div class="entry-thumbnail coverback" style="background-image: url(&lt;?php echo wp_get_attachment_image ( int $attachment_id, string|array $size = 'medium', bool $icon = false, string|array $attr = '' );  ?&gt;); "&gt;
  </code></pre>
  
  <p>and</p>
  
  <pre><code>&lt;div class="entry-thumbnail coverback" style="background-image: url(&lt;?php echo wp_get_attachment_image( get_the_ID(), array('medium') );  ?&gt;); "&gt;
  </code></pre>
  
  <p>but not one of them worked, what am I doing wrong here? I have tried to use the WP Codex and stuff, but.. that mostly confused me more than it helped :(</p>
  
  <p>Any help would be really appreciated.</p>