PDF Downloader By ACF Plugin

Share Now

Share on facebook
Share on pinterest
Share on twitter
Share on linkedin
Share on email

Change these two according two your code:
d_file
pdf_thumbnail

<?php 
   $file = get_field( "d_file" );
   if( $file ) {
   	$file_url = wp_get_attachment_url( $file );
   	$file_thumb = get_field( "pdf_thumbnail", $file );
   
   	if( $file_thumb ) {
   		$file_thumb_details = wp_get_attachment_image_src( $file_thumb,"full" );
   		echo "<a target='_blank' href='{$file_url}'><img src='" . esc_url( $file_thumb_details[0] ) ." '/></a>";
   	}else{
   
   		echo "<a target='_blank' href='{$file_url}'>{$file_url}</a>";
   	}
   } 
?>

Nahid Mahamud

Nahid Mahamud

Web Developer | Graphic Designer | WordPress & Woo-commerce Expert