WordPress.org

Support

Support » Plugins and Hacks » List Related Attachments » [Resolved] [Plugin: List Related Attachments] CSS Styles based on mime type…

[Resolved] [Plugin: List Related Attachments] CSS Styles based on mime type…

  • 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…

Viewing 4 replies - 1 through 4 (of 4 total)
  • 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?

    Plugin Author Baden

    @baden03

    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!

    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…

    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

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[Resolved] [Plugin: List Related Attachments] CSS Styles based on mime type…’ is closed to new replies.
Skip to toolbar