Possible to give file-attachment link a class (2 posts)

  1. hixen
    Posted 5 years ago #

    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>
        <a href="http://www.mysite.com/wp-content/uploads/2010/10/myfile.pdf">My PDF file</a>

    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:

        <a class="attachment pdf" href="http://www.mysite.com/wp-content/uploads/2010/10/myfile.pdf">My PDF file</a>

    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.


  2. hixen
    Posted 5 years ago #

    I found this thread and it explains my question much better. She never really got the answer she was looking for and that was 1 year ago. I would reply to her topic since it's much better, but it's closed :(


    Anyone with some experience from this?

Topic Closed

This topic has been closed to new replies.

About this Topic