If your WordPress theme originates from Underscores and you have not changed the default code in the footer there is a good chance that the Theme Check plugin will show that there is a possible hard-coded link in the code. This bit of information does not mean that there is anything wrong with your theme but for a user or prospective user of your theme, this bit of information could be problematic.

The days of only theme developers using the Theme Check plugin are long past. There are so many articles out there informing everyone just how nifty this little plugin is in detecting errors in WordPress themes. Everyone, even those just trying to find a nice theme for their site now uses Theme Check.

Let’s say I know nothing about theme development, I just want a killer theme for my site. I have found two or three themes that could do the job but now I am going to use Theme Check to make my last choice. I do not really know what I am checking for but I would want a nice clean report from the plugin. Now I get to your theme, and all of a sudden I see this message that says ‘possible hard coded links”. I will most probably head for the hills and I will not use your theme.

I can just imagine the support queries the premium theme guys are receiving because their users are also using the same plugin.

We all need to pay more heed to the smaller things, this message in Theme Check is easily avoidable and should never have been there in the first place. The Theme Check message is there because you included links without escaping them. It is something like the following in your footer.php that is causing all this:

So how do we fix this? There are many ways. What I do in my themes is to replace the code shown with something like the following:

That’s it, problem gone. In this example I have not only escaped the URLs but I have changed the link text anchors somewhat to facilitate more customisation options.

If only all life’s problems were this easy to fix! Thanks for visiting.

Write a Reply or Comment

Your email address will not be published. Required fields are marked *