title: How to get the medium size post thumbnail url in wordpress?
body: <p>What I figured out so far:</p>
  
  <p>I have a query like this:</p>
  
  <pre><code>$categories=get_category_by_slug('my_category_slug')
  $posts_array = get_posts( array('category'=&gt;$categories-&gt;cat_ID, 'numberposts' =&gt; -1 ));
  foreach($posts_array as $post_array){
      $queried_post = get_post($post_array-&gt;ID);
      //I can get the source file link this way: wp_get_attachment_url( get_post_thumbnail_id($queried_post-&gt;ID))
  }
  </code></pre>
  
  <p>But the source file is just to big. Functions like <code>the_post_thumbnail( medium )</code> won't work for me because it's not just url. It's an url with image tag wrapper etc. So is there a way just to get the link to the medium (or small) size file?</p>
  
  <p>It's also possible to set the post thumbnail size in the functions.php after the line with the theme support and post-thumbnail:</p>
  
  <pre><code>add_theme_support( 'post-thumbnails' );
  set_post_thumbnail_size( 300, 300 );
  </code></pre>
  
  <p>I didn't try that but I don't want to set the size of all thumbnails.</p>