Style mp3 links differently from other links (5 posts)

  1. 3stripe
    Posted 10 years ago #

    I'm trying to work out if there's anyway you could automatically make links in my posts ending with .mp3 have a different style than the rest.

    Is this possible or do I need to do it via the enclosures?
    Only problem with enclosures's is they would have to display before/after the post content I guess.

  2. marcy
    Posted 10 years ago #

    I don't know what enclosures are... but you could make a class, like

    style stuff

    <a class="music" href="musicfile.mp3">Music file</a>

  3. 3stripe
    Posted 10 years ago #

    Thanks, that looks good. I'm fine with changing links like that but I've got other folks using the site who won't be able to do that...

    Hmm... maybe I should have a div class for my downloads section and then I could style links in that however I wanted, so long as no-one added any other links to the posts...

  4. marcy
    Posted 10 years ago #

    Yeah, if the music links are all grouped together in a div that would work well and should be user-proof.

    I'm the only user at my site so I don't know anything about that sort of thing -- hopefully if you need more help someone else will step in.

  5. 3stripe
    Posted 10 years ago #


    Well the only other thing I wondered was if WordPress could add that .music class to links of it's own accord. It must be able to recognise mp3 links as it can add them to a podcast feed all on it's ownsome.

Topic Closed

This topic has been closed to new replies.

About this Topic