Downloadable Documents

No need to insert the download into the post as @kaiser says, you can automate:

$download = get_children( 'post_type=attachment&post_mime_type=application/pdf&post_parent=".$post->ID );

if ($download) {
    foreach ( $download as $attachment_id => $attachment ) {
        echo "<a href="'.wp_get_attachment_url($attachment_id).'" target="_blank" class="download">Download PDF</a>';
    }
}   

Leave a Comment