Home › Forums › Front-end Issues › Split: Template Code doesn't work › Reply To: Split: Template Code doesn't work
Hi @elliot
I have the same issue, I used your solution but still i can not able to display the file size. Other than your solution i also tried this.
$attachment_id = get_field('attach_report');
$url = wp_get_attachment_url( $attachment_id );
$title = get_the_title( $attachment_id );
$filesize = $attachment_id;
$filesize = size_format($filesize, 2);
echo '<a href="'. get_field('attach_report') .'" download>Download PDF (' . $filesize .' ) </a>';
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.