-
-
Save smjuber/97abd36380ce8f74b655ca6c7ae0b41f to your computer and use it in GitHub Desktop.
This file contains hidden or 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
<?php | |
$args = array( | |
'post_type' => 'attachment', | |
'numberposts' => -1, | |
'post_status' => null, | |
'post_parent' => $post->ID | |
); | |
$attachments = get_posts( $args ); | |
if ( $attachments ) { | |
echo '<ul id="gallery" class="thumb-grid">'; | |
foreach ( $attachments as $attachment ) { | |
$large_image = wp_get_attachment_image_src($attachment->ID,'large',false); | |
echo '<li><a href="' . $large_image[0] . '">'. wp_get_attachment_image( $attachment->ID, 'thumbnail' ) .'</a></li>'; | |
} | |
echo '</ul>'; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment