Ver Mensaje Individual
  #3 (permalink)  
Antiguo 25/06/2012, 15:12
Zar02
 
Fecha de Ingreso: junio-2012
Mensajes: 61
Antigüedad: 11 años, 10 meses
Puntos: 1
Respuesta: Mostrar imagen del post en thumbnail...

Cita:
Iniciado por rogertm Ver Mensaje
Tendrías que meter el código que tienes dentro de un if()... si ese if no se cumple, entonces dentro de un else()... le agregas este código que viene en Twentyten:
Código PHP:
Ver original
  1. <?php
  2.     $images = get_children( array( 'post_parent' => $post->ID, 'post_type' => 'attachment', 'post_mime_type' => 'image', 'orderby' => 'menu_order', 'order' => 'ASC', 'numberposts' => 999 ) );
  3.     if ( $images ) :
  4.         $total_images = count( $images );
  5.         $image = array_shift( $images );
  6.         $image_img_tag = wp_get_attachment_image( $image->ID, 'thumbnail' );
  7. ?>
  8.         <div class="gallery-thumb">
  9.             <a class="size-thumbnail" href="<?php the_permalink(); ?>"><?php echo $image_img_tag; ?></a>
  10.         </div><!-- .gallery-thumb -->
  11.         <p><em><?php printf( _n( 'This gallery contains <a %1$s>%2$s photo</a>.', 'This gallery contains <a %1$s>%2$s photos</a>.', $total_images, 'twentyten' ),
  12.                 'href="' . get_permalink() . '" title="' . sprintf( esc_attr__( 'Permalink to %s', 'twentyten' ), the_title_attribute( 'echo=0' ) ) . '" rel="bookmark"',
  13.                 number_format_i18n( $total_images )
  14.             ); ?></em></p>
  15. <?php endif; ?>

Básicamente lo que hace es mostrar la primera imagen del post. OJO: no la primera que esté, sino la primera que se subió.

Saludos.
Hola, no me funcionó , si quieres te paso el código que tengo:

Código PHP:
// Thumbnails 150x150 
add_theme_support'post-thumbnails' ); 
add_theme_support'post-thumbnails' );
set_post_thumbnail_size150150true ); // Dimensión default de nuestro thumbnail 
Gracias.