Support

Account

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>';