External Links Wordpress Plugin Comments RSS feed

External links:
The little images that appear after an external link on this site used to be created by pure CSS, using the following rules:

.commentlist a[href*="http"], .storycontent a[href*="http"]
{
padding-right: 12px;
background: url(‘/wp-images/ext-link.gif’) right top no-repeat;
}
.commentlist a[href*="jfoucher.info"], .storycontent a[href*="jfoucher.info"]
{
padding-right: 0;
background-image: none;
}

But, as you may know, this does not work in Internet Explorer. So I decided to write a little plugin that would give a specific class attribute to all external links, so that they can be styled in a manner recognizable to IE.

Languages
Additionally, as this is a bilingual blog, I like to show an language text after each link, like this. I used to do it in pure CSS, like so:

a[hreflang]:after {
content:”000a0[" attr(hreflang) "]“;
color:#999;
background:transparent;
font-size:0.8em
}

but you guessed it, it doesn’t work in IE, so this little plugin takes care of that as well… All you need to do is add an hreflang=”whatever” attribute to your links.

Installation:

  1. Download the
    Liked it? Share it!

5 Responses to “External Links Wordpress Plugin”

  1. [...] comments made by spambots), and a plugin to mark external links with a little symbol. This really useful plugin [en [...]

  2. New Stuff :)
    For those who notice – just small tiny adjustments to my blog….

  3. Minna says:

    Hey, I like your plugin :) I noticed though that it has a hard time recognising links with filename.php?some=value although I can’t figure out why because the regexp should handle them too… maybe the error’s at my end, but have you or someone else come across the same thing? Well, now that I checked, there are icon-less links for example in a post titled Wordpress and StatTraq (one of yours, that is)

  4. HalilK says:

    Good plugin, thx.

    My Firefox didnt show the image. After some minutes I have seen that you wrote

    background:url(/wp-images/ext-link.png) right top no-repeat;

    but it must be

    background:url(‘/wp-images/ext-link.png’) right top no-repeat;

    Isnt it so? Or am I wrong? After that it worked. :)

  5. Jonathan says:

    Yeah, that seems to be a problem, although I don’t have a clue why that could be…

Leave a comment

If you register, these will be filled automatically