WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. hixen
    Member
    Posted 3 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>
    <p>
        <a href="http://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="http://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.

    http://www.tgrayimages.com/automate-file-attachments-on-your-wordpress-posts/

  2. hixen
    Member
    Posted 3 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 :(

    http://wordpress.org/support/topic/add-custom-css-classes-to-add-media-uploads?replies=12

    Anyone with some experience from this?

Topic Closed

This topic has been closed to new replies.

About this Topic