Get attachment URL (any file) in WordPress
<?php
$post = get_posts(7);
$ch = get_children(array('post_parent' => $post->ID,'numberposts' => 1,'post_type' => 'attachment'),ARRAY_A);
$ra = array_values($ch);
$idfile = $ra[0]['ID'];
$pdf = wp_get_attachment_url($idfile);
echo $pdf;
?>