Posts tagged ‘microformats’

Write custom rel tags for your links in Wordpress 2.5.1

Since I experienced the same issue, I wanted to share how I solved it.

I was adding a link to my site using Wordpress 2.5.1’s admin window and I noticed that I couldn’t modify the link’s rel tag at my own will, yet I could see how my rel tag was looking so far in the “Link Relationship (XFN)”. When I try to edit the rel tag manually a javascript tries to automatically rebuild based on your checkbox choices.

Wordpress 2.5.1\'s admin Link Relationship section

If you have this exact wordpress version (I don’t know about others) you can solve this and have the link admin let you modify rel tags as you choose by going into the code and modifying /wp-admin/js/xfn.js inserting after line 41 this:

if ((aInputs[i].name != "link_rel") && (aInputs[i].name != "save"))

This modifies the “blurry” function to make it look like this:

function blurry() {
        if (!document.getElementById) return;

        var aInputs = document.getElementsByTagName(‘input’);

        for (var i = 0; i < aInputs.length; i++) {
                if ((aInputs[i].name != "link_rel") && (aInputs[i].name != "save"))
                 aInputs[i].onclick = aInputs[i].onkeyup = upit;
        }
}

This is useful for those that want to have complete control of their site’s microformats.