Ver Mensaje Individual
  #7 (permalink)  
Antiguo 30/01/2009, 19:49
Avatar de metacortex
metacortex
Viejo demente
 
Fecha de Ingreso: junio-2004
Ubicación: Caracas - Venezuela
Mensajes: 9.027
Antigüedad: 19 años, 11 meses
Puntos: 832
Respuesta: Tutorial: Cómo extraer miniaturas de imágenes en Wordpress

Prueba así a ver:

Código PHP:
function mi_imagen($tamano '') {
  if ( 
$images get_children( array (
    
'post_parent'    => get_the_ID(),
    
'post_type'      => 'attachment',
    
'numberposts'    => 1,
    
'post_mime_type' => 'image'
   
)));
  {
    foreach( 
$images as $image ) {
      if(
$tamano == 'mini') {
      
$imagen wp_get_attachment_image$image->ID'thumbnail' );
      } if(
$tamano == 'medio') {
      
$imagen wp_get_attachment_image$image->ID'medium' );
      } if(
$tamano == 'grande') {
      
$imagen wp_get_attachment_image$image->ID'full' );
      } if(
$imagen == null ); {
      
$imagen '<img src="directorio/imagen.jpg" alt="imagen" />';
      }
      echo 
$imagen;
    }
  }