Skip to content

Instantly share code, notes, and snippets.

@sivel
Created April 14, 2009 20:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sivel/95420 to your computer and use it in GitHub Desktop.
Save sivel/95420 to your computer and use it in GitHub Desktop.
<?php
$attachments = get_children('&post_type=attachment&post_mime_type=image&post_parent=true');
foreach ( $attachments as $attach )
echo "<a href='" . get_permalink($attach->post_parent) . "'><img src='" . wp_get_attachment_thumb_url($attach->ID) . "' alt='' /></a>";
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment