Skip to content

Instantly share code, notes, and snippets.

@EdwardIII
Created May 19, 2011 09:17
Show Gist options
  • Save EdwardIII/980453 to your computer and use it in GitHub Desktop.
Save EdwardIII/980453 to your computer and use it in GitHub Desktop.
$args = array( 'post_type' => 'attachment', 'numberposts' => -1, 'post_status' => null, 'post_parent' => $post->ID );
$attachments = get_posts($args);
if ($attachments) {
foreach ( $attachments as $attachment ) {
echo apply_filters( 'the_title' , $attachment->post_title );
echo apply_filters( 'the_content' , $attachment->post_excerpt);
the_attachment_link( $attachment->ID , false );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment