Need to be able to get the attachment link... (3 posts)

  1. bluegum
    Posted 4 years ago #

    With my client's website I need to be able to get the pdf (attachment) link which has been placed into WordPress via Media, and attached it to a download button per page, this enables the user to download a part of that particular page. Anyway here is one part of what I have started:

    if (is_page('1.5 Tonne Self-Loading Cable Trailer')) {
    				echo '<div class="download">';
    				echo '<a href="http://www.domainname.com/wp-content/uploads/2011/11/1-5-tonne-self-loading-cable-trailer.pdf"><img src="<?php bloginfo('template_url'); ?>/images/downloadbtn.gif" alt="Download the 1.5 Tonne Self-Loading Cable Trailer page as a pdf" width="81" height="31" /></a>';
    				echo '</div>';

    Thanks in advance.

  2. Pioneer Web Design
    Posted 4 years ago #

    Many web hosts have removed the mime type for PDF files for security and other reasons (it's a proprietary format). Consult with your web host first.

  3. bluegum
    Posted 4 years ago #

    My web host hasn't removed the mime types for PDFs. So could someone please tell me how do this?

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.