Yo fellow foresters,
The technique of showing a feature or lead image in those ‘magazine’ style themes is pretty cool huh?
( you know like Net Tuts )
Getting clients or users to fiddle around with image paths and custom fields isn’t so cool.
So I was happy when I found this function called catch_that_image which scans the post and grabs the first image that is in it. You can then use something like the amazing Tim Thumb script to resize, crop and display them.
This was great. But what if my post had an external/remote image that couldn’t be cropped, or just had a video and no image? Or I wanted to show a specific image? or not image at all?
Well, I fiddled with the catch_that_image function to create grab_that_image, a slight variation with more options.
So, to sum it up.
- You need Tim Thumb up and running - A custom field called first_img, which you set to say ‘none’ if you don’t want an image to show - upload a default image to use as a fall back to /wp-content/uploads/default.jpg
I am not a code genius, so someone may see a better way to do things but I have tried to make it understandable and easy to implement on your own sites – feel free to suggest improvements or tell me why it’s total rubbish
(go easy though)
Here it is: http://pastie.org/630269
So in your loop you can insert grab_that_image() wherever you want the result to appear… which in some cases will be nothing 
I hope you find it useful – I dunno, maybe someone has already done this but better somewhere else, bu this offers enough options to cover you for all evetulaities and is easy for users/clients to use.
See ya
