Hello
When using a “URL” type ACF field to point to an external .pdf file “Publication Link”, when clicking on the link the file extension is removed, landing on a parent page.
<figure class="publication-header-media">
<?php
$cover = get_field('cover');
$size = 'full'; // (thumbnail, medium, large, full or custom size)
$book_link = ( get_field('link') );
if( $cover ) {
echo '<a href="' . $book_link .'">' . wp_get_attachment_image( $cover, $size ) . '</a>';
}
?>
</figure>
I suppose this is a server redirect.
If I enter the URL directly into the browser address bar, the pdf loads in the pdf viewer.
Is there a way I can force the file to download / load in the pdf viewer ?