Skip to content

Instantly share code, notes, and snippets.

@oquno
Created September 7, 2010 14:01
Show Gist options
  • Save oquno/568373 to your computer and use it in GitHub Desktop.
Save oquno/568373 to your computer and use it in GitHub Desktop.
<?php if (have_posts()): while (have_posts()): the_post(); ?>
<?php preg_match('/<img\ssrc="(http:\/\/farm\d+\.static\.flickr\.com\/.*\.jpg)/', $post->post_content, $matches); ?>
<?php if($matches[1]): ?>
<?php $thumbnail_image_url = preg_replace('/_.\.jpg$/', '_s.jpg', $matches[1]); ?>
<img src="<?php echo $thumbnail_image_url; ?>" width="75" height="75" />
<?php endif ?>
<?php endwhile; endif ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment