Ver Mensaje Individual
  #7 (permalink)  
Antiguo 06/10/2010, 15:00
Avatar de CSSCREATIVO
CSSCREATIVO
 
Fecha de Ingreso: octubre-2010
Mensajes: 26
Antigüedad: 13 años, 6 meses
Puntos: 1
Respuesta: imagen previa en el index

Bueno mm estube jugando con codigos que me diste y encontre las respuesta sin usar timthumb

primero agregamos esto al functions.php

Código:
<?php function get_first_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 la imagen "default"
$first_img = "/images/default.jpg";
}
return $first_img;
} ?>

y en el index o donde quieras agregas lo siguiente

Código:
<img src="<?php echo  get_first_image(); ?>"  alt="<?php the_title(); ?>" />

Bueno espero que le sirva a alguien mas :D hah (Y)