waaaaa Translation
choose your color
reset

TimThumb

WordPress: extract an image from a post with catch_that_image

Published in Blog

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

Published in Blog

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 [...]

...
2000 - 2010 All Right Reserved | The contents are the exclusive property of IDEAM snc. And 'forbidden even partial reproduction. IDEAM snc PI. 01415820479