Ver Mensaje Individual
  #5 (permalink)  
Antiguo 01/12/2010, 18:48
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: Mostrar imagen grande al hacer click en miniatura

Prueba así CorpseOfSteel:

Código PHP:
Ver original
  1. <?php query_posts('cat=1'); ?>
  2. <?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>  
  3. <?php
  4. $args = array(
  5.     'post_type' => 'attachment',
  6.     'post_mime_type' => 'image',
  7.     'numberposts' => 1,
  8.     'order' => 'menu_item',
  9.     'post_parent' => get_the_ID()
  10. );
  11. $attachments = get_posts($args);
  12. if ($attachments) {
  13.     foreach ($attachments as $attachment) {
  14.         $mini = wp_get_attachment_image_src( $attachment->ID, 'thumbnail' );
  15.         $grande = wp_get_attachment_image_src( $attachment->ID, 'full' );
  16.         $miniatura= '<img src="'.$mini[0].'" width="'.$mini[1].'" height="'.$mini[2].'" alt="'.get_the_title().'" title="'.get_the_title().'" />' ."\n";
  17.     }
  18. }
  19. ?>
  20. <a href="<?php echo $grande[0] ?>"><?php echo $miniatura ?></a>
  21. <?php endwhile; endif; ?>