Possible to give file-attachment link a class
-
When working with a page or a post and you wanna add one or more file-attachments to it, you can do so by uploading the files to the post and then insert a link where you want them to show up in your content.
For example it could look something like this (the output):
<h1>Headline of post</h1> <p>Some random text about something... after this paragraph I will upload a PDF file and insert into post</p> <p> <a href="https://www.mysite.com/wp-content/uploads/2010/10/myfile.pdf">My PDF file</a> </p>
My problem is that my attachment link doesn’t give me anything to work with when it comes to style the it. In the above example I used a PDF file, how cool wouldn’t it be if the link got a class that said it was an attachment and a PDF file, kinda like:
<p> <a class="attachment pdf" href="https://www.mysite.com/wp-content/uploads/2010/10/myfile.pdf">My PDF file</a> </p>
Well I hope you boys and girls understand what I’m looking for. Would be great if anyone know a hack or a plugin for this.
Btw: I found this post, and it worked pretty good, problem is I wanna do this and be able to choose where in my text I wanna have each of the file-attachments.
https://www.tgrayimages.com/automate-file-attachments-on-your-wordpress-posts/
- The topic ‘Possible to give file-attachment link a class’ is closed to new replies.