Skip to content

Instantly share code, notes, and snippets.

@theukedge
Created September 14, 2013 21:45
Show Gist options
  • Save theukedge/6565941 to your computer and use it in GitHub Desktop.
Save theukedge/6565941 to your computer and use it in GitHub Desktop.
<?php // get post attachments
$post_attachments = get_posts( array (
'post_type' => 'attachment',
'post_parent' => $post->ID
));
?>
<ul>
<?php foreach ( $post_attachments as $post_attachment ) {
echo '<li>' . wp_get_attachment_link( $post_attachment->ID, '', false, false ) . '</li>';
} ?>
</ul>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment