Download attribute not working
-
I’m trying to add a “download” attribute to a link, e.g.,
<a href="file" download>link display</a>and I also tried
<a href="file" download="another name">link display</a>The WordPress editor silently strips out the download attribute when saving the posting.
Any ideas?
The blog I need help with is: (visible only to logged in users)
-
Good Morning –
WordPress.com does have a limit on the types of code you can embed due to our shared environment. More details on that are in this guide:
https://en.support.wordpress.com/code/Can you post the original code snippet here so I can verify this? Also, which site are you working on?
-
Thanks, the “a” code is supported in that list, and “download” is an attribute of the “a” code.
The code as it now exists is:
‘Download: Ministry
I am attempting to add the attribute “download” after the file link, but the WordPress editor deletes it when I press Update.
The site is https://jjministry.org
-
That didn’t show up right. The code is:
Download: <a href="https://dq9akitthl5x3.cloudfront.net/MinistryBBSKember11272016.mp3">Ministry</a> -
<a href="WORDS TO BE LINKED">https://dq9akitthl5x3.cloudfront.net/MinistryBBSKember11272016.mp3</a>Does this example work? Just change the “words to be linked” portion to whatever you want.
-
-
< a href=”WORDS TO BE LINKED”>https://dq9akitthl5x3.cloudfront.net/MinistryBBSKember11272016.mp3
There we go! It looks like you may have a space after your
a -
I think the html5 syntax is as follows:
<a href="url" download>Words to be linked</a>But the WordPress editor is silently deleting the “download” attribute so what I end up with is:
<a href="url">Words to be linked</a>and since the browser recognizes that the url represents an audio file, it opens it up in a new tab instead of downloading it, which is what I want.
-
Hello –
If you’d like to have folks download the mp3 my suggestion is to tell them to “right click > save as”.
-
Here are the instructions to create a download link: https://en.support.wordpress.com/audio/#create-a-download-link
-
I’m interested in this too. I am helping someone with their WordPress site, and they want to allow readers to download documents, not open them in the browser or require a “right click” instruction.
So are you able to say please whether WordPress intentionally strips out the “download” attribute, and is there a workaround?
Thanks.
- The topic ‘Download attribute not working’ is closed to new replies.