Where Do I Upload a Pdf on My Wordpress Site
Read Time: 3 mins Languages:
In this tutorial you'll learn how to upload or link a PDF file to WordPress. If yous've ever uploaded an image to the media library in WordPress, doing the same with a PDF is but as straightforward, and then let me explain how to do that.
Upload a PDF to WordPress
Follow along with the states over on our Envato Tuts+ YouTube channel:
1. Locate Your PDF File
I'm working with a demo PDF file on my system. Brand certain the file size isn't too big (your PHP hosting will likely take a limit on file upload sizes) and ideally your file'due south filename shouldn't contain any strange characters either.
In your WordPress admin go to Media > Library > Add New then utilise the file chooser to select your PDF, or drag and drop information technology into the browser:
Once uploaded you lot'll be able to give the file a title, a caption, and a description (if you want). And that's how to upload a PDF to WordPress! Now allow'south see a few ways nosotros can link to the PDF.
2. Copy and Paste the PDF File Link
Well-nigh chiefly y'all'll need the link to the file, and so copy the whole path as y'all see information technology displayed:
Y'all can then use that link and attach it to text in pages or posts within WordPress, past highlighting your called link text and calculation a link similar so:
Once saved, when you view the post on the front end of your website, the link volition be present and when clicked volition open your PDF in a browser window.
Linking From Images and Buttons
The same affair is possible with images and buttons. For instance, upload an image to the WordPress Gutenberg editor, then click the link icon to add the PDF link:
three. Using the Classic WordPress Post Editor
What if you're not using Gutenberg? The same is possible using the Classic WordPress editor also—the link button is constitute in the toolbar at the top of the editor:
And that'southward how you link to a PDF in WordPress! Merely await, there's one more thing I want to explain..
4. How to Directly Download a PDF From a Link
Before we wrap things upwards, here'due south an additional trick. What if y'all don't want users to click your PDF link and open the PDF in another browser window? What if, instead, you'd like the PDF to directly download?
To achieve this, we need access to the HTML markup of the link itself. So in the Classic Editor switch to the text tab:
In the Gutenberg editor yous tin gain access to the HTML code by clicking the three dots (options) carte like so, and hitting Edit equally HTML:
Then (if you're familiar with reading HTML lawmaking) discover the link in question, which should wait something like this:
<a href="https://link" target="_blank" rel="noopener">Download PDF</a>
And then add together the download attribute, anywhere within the main anchor tag, like this:
<a href="https://link" target="_blank" rel="noopener" download>Download PDF</a>
That'south it! Now when someone clicks the link it will download the PDF to their system.
To learn more most how the download attribute works, here's a useful guide:
That'southward All In that location is to information technology!
That'southward how you lot tin upload a PDF to your WordPress website, and how you tin link to it in a few different ways. I promise you found this tutorial useful, take a look at the following resource for more than beginners' tips!
Did you find this mail useful?
Source: https://webdesign.tutsplus.com/tutorials/how-to-upload-pdf-to-wordpress--cms-35358
0 Response to "Where Do I Upload a Pdf on My Wordpress Site"
Post a Comment