Skip to content

Instantly share code, notes, and snippets.

@lohic
Last active March 15, 2017 02:16
Show Gist options
  • Save lohic/11062716 to your computer and use it in GitHub Desktop.
Save lohic/11062716 to your computer and use it in GitHub Desktop.
<?php
$args = array( 'post_type' => 'attachment', 'orderby' => 'menu_order', 'order' => 'ASC', 'post_mime_type' => 'image' ,'post_status' => null, 'numberposts' => null, 'post_parent' => $post->ID );
$alt = get_post_meta($attachment->ID, '_wp_attachment_image_alt', true);
$image_title = $attachment->post_title;
$caption = $attachment->post_excerpt;
$description = $image->post_content;
$attachments = get_posts($args);
if ($attachments) {
foreach ( $attachments as $attachment ) { ?>
<a href="<?php echo wp_get_attachment_url( $attachment->ID, false ); ?>" rel="lightbox" title="<?php echo $image_title; ?>"><img src="<?php bloginfo('template_url'); ?>/timthumb.php?h=75&w=75&zc=1&src=<?php echo wp_get_attachment_url( $attachment->ID , false ); ?>" alt="" width="75" height="75" border="0" /></a>
<?php } } ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment