Ver Mensaje Individual
  #2 (permalink)  
Antiguo 25/06/2012, 08:25
Avatar de rogertm
rogertm
Mod->Cuba
 
Fecha de Ingreso: julio-2005
Ubicación: /home/Cuba/Habana/rogertm/
Mensajes: 2.922
Antigüedad: 18 años, 9 meses
Puntos: 638
Respuesta: Mostrar imagen del post en thumbnail...

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.
__________________
Friki y Blogger por Cuenta Propia:213
Twenty'em: Theming is Prose