Created
February 10, 2015 18:37
-
-
Save marceloag/884a8c035f825091bacd to your computer and use it in GitHub Desktop.
Todas las imagenes de un post
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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