WordPress.org

Ready to get started?Download WordPress

Forums

List Related Attachments
[resolved] CSS Styles based on mime type... (5 posts)

  1. swill
    Member
    Posted 3 years ago #

    I updated this plugin slightly so I could style the different list items based on the mime type. With the following code I was able to style PDFs, DOCs and such different.

    Original Code: (in file list-rel-attach.php)
    [Code moderated as per the Forum Rules. Please use the pastebin]

    What I added:
    [Code moderated as per the Forum Rules. Please use the pastebin]

    (I added '+' in order to note the changes I made).

    Basically what this does is the following.

    If you have a mime type of 'application/pdf', it adds a class to the <li> resulting in <li class="mime-pdf">.

    From there you can style the 'li' or the 'a' inside it however you want.

    Hope someone finds this helpful...

  2. robertjakobson
    Member
    Posted 3 years ago #

    Could the person who edited this just explain why they did not copy the contents of the file they deleted to paste bin if they were grand enough to delete code?

  3. Baden
    Member
    Plugin Author

    Posted 3 years ago #

    Hey swill, if you can let us know (again) exactly what you did, we will consider adding it as a feature in an upcoming release.

    And really, thumbs up to the moderator for really promoting that open-source thinking!

  4. swill
    Member
    Posted 2 years ago #

    It is really funny that my code got removed. Why do you have a 'code' highlighting type if you cant put code in here without it being deleted??? Now I have to do a whole bunch of research including installing the base plugin again in order to figure out what I changed.

    Real annoying...

    I will see if I can figure out what I changed...

  5. swill
    Member
    Posted 2 years ago #

    I do now know what the code originally was, but this is what my 'widget_listattach' function looks like now.

    Hope this helps people: http://pastebin.com/c5RfpPZX

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic