title: Wordpress Pinterest Pin It Button. Manual Code
body: <p>I have some Pinterest code to show a Pin it button on my wordpress posts but it only grabs the post thumbnail. What I want is to grab the first post content image and only grab the thumbnail if there are no images in the post!??</p>
  
  <p>Have tried tons of examples but nothing works.</p>
  
  <pre><code>&lt;a href="http://pinterest.com/pin/create/button/?url=&lt;?php the_permalink(); ?&gt;&amp;media=&lt;?php $thumb = wp_get_attachment_image_src( get_post_thumbnail_id($post-&gt;ID), 'thumbnail' ); echo $thumb['0']; ?&gt;&amp;description=&lt;?php the_title(); ?&gt;" class="pin-it-button" count-layout="horizontal"&gt;Pin It&lt;/a&gt;
  </code></pre>