I use this function in my wordpress function.php
<?php
function catch_that_image() {
global $post, $posts;
$first_img = '';
ob_start();
ob_end_clean();
$output = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $post->post_content, $matches);
$first_img = $matches [1] [0];
if(empty($first_img)){ //Defines a default image
$first_img = "/images/default.jpg";
}
return $first_img;
}
?>
and call in archive, search and other wp phps with this:
<img src="<?php echo catch_that_image() ?>" width="250">
Here is the problem, all I need is offtheme support, since I don't use WordPress for upload images and inserting into the post. I need that each image that appears will be automatically resized to width 250 and 141 height.
Currently they are just used as the big images and resized via width height entries. I need new function that will make custom sized jpg files and use them.
Check this Link and you will understand what I want. How can I do that?