TimThumb
WordPress: extract an image from a post with catch_that_image
Here is a simple function to extract the first image from the content of your post.
function catch_that_image() {
global $post, $posts;
$first_img = ”;
ob_start();
ob_end_clean();
$output = preg_match_all(‘/<;pic. src =['"]([^'"]+)['"].*>/i’, $text, $matches);
$first_img = $matches [1] [0];
// If there are images in post, returns the default image
if(empty($first_img)){
[...]
Add TimThumb a WordPress template
TimThumb PHP Script is a PHP script customization with options for cropping and resizing. There are many uses for this script into a WordPress template style magazine. TimThumb is released under open source license and then I'll show you how to exploit it to create websites with WordPress.
1. Seven [...]










