Skip to content

Instantly share code, notes, and snippets.

@eveevans
Created August 3, 2012 21:28
Show Gist options
  • Save eveevans/3251688 to your computer and use it in GitHub Desktop.
Save eveevans/3251688 to your computer and use it in GitHub Desktop.
extraer todas las imagenes asociadas de un post
<h1><?php the_title() ?></h1>
<?php
$images = get_children( array( 'post_parent' => $post->ID, 'post_type' => 'attachment', 'post_mime_type' => 'image', 'orderby' => 'menu_order', 'order' => 'ASC', 'numberposts' => 999 ) );
if ( $images ) :
?>
<?php foreach($images as $ima): ?>
<div class="gallery-thumb ev-gallery">
<a rel="ev-gallery" class="size-thumbnail" href="<?php echo wp_get_attachment_url($ima->ID); ?>"><?php echo wp_get_attachment_image( $ima->ID, 'thumbnail' ); ?></a>
</div>
<?php endforeach;
?>
<?php endif; ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment