Skip to content

Instantly share code, notes, and snippets.

@marceloag
Created February 10, 2015 18:37
Show Gist options
  • Save marceloag/884a8c035f825091bacd to your computer and use it in GitHub Desktop.
Save marceloag/884a8c035f825091bacd to your computer and use it in GitHub Desktop.
Todas las imagenes de un post
<ul class="large-block-grid-2">
<?php
$attachments = get_children(array('post_parent' => $post->ID,
'post_status' => 'inherit',
'post_type' => 'attachment',
'post_mime_type' => 'image',
'order' => 'ASC',
'orderby' => 'menu_order ID'));
foreach($attachments as $att_id => $attachment) {
$full_img_url = wp_get_attachment_url($attachment->ID);
?>
<li><img src="<?php echo $full_img_url;?>" alt=""></li>
<?php
}
?>
</ul>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment