KeywordLuv - Theme Compatibility Issue
This page explains the compatibility issue that the KeywordLuv plugin has with some WordPress themes and the options to get around it.
The Problem
KeywordLuv works by filtering the following functions:
- comment_author_link() OR get_comment_author_link()
If your theme uses one of these functions to display the comment author link, KeywordLuv will work. However, it will not work if your theme manually builds the comment author link, using the following functions:
- comment_author() OR get_comment_author() AND
- comment_author_url() OR get_comment_author_url()
From what I can tell, most themes will use the first method. However, there are themes that use the second method.
How Do I Find Out If My Theme Is Compatible?
To find out if your theme is compatible, you can either:
a) Try the plugin: Activate it, leave a comment using the Name@Keywords notation (in the Name field). If the Name part appears before the link, your theme is compatible. If it appears exactly as you typed it, it’s not compatible.
OR
b) Check your theme: Look in the comments.php file for your theme and search for comment_author_link() or get_comment_author_link(). If you can’t find one of these, then it is likely that your theme is not compatible.
Note: If you use Brian’s Threaded Comments or YATCP for threaded comments, KeywordLuv will work, as it does not use your theme’s comments.php file.
What If I Really Want To Use KeyWordLuv?
If your theme is not compatible, there are several options open to you:
1. Use KeywordLuv’s Compatibility Mode
From KeywordLuv 1.02, you can run the plugin in Compatibility Mode. Here’s how you set it up:
- Go to the KeywordLuv Options screen in the WordPress Admin area, select the Compatibility Mode setting and Save Changes.
- Use FTP to go to the wp-content/themes/[yourtheme] folder on your server and download the comments.php file.
- IMPORTANT: Make a copy of the comments.php file so you can put it back if something goes wrong.
-
Edit the comments.php file and find the line that adds the comment author’s name. It normally looks something like this:
<a href="<?php comment_author_url();?>"><?php comment_author();?> </a>
-
Add the following immediately before it, leaving the line intact:
<?php if (function_exists(’keywordluv_name’)) keywordluv_name();?>
- Save the file and FTP it up to the wp-content/themes/[yourtheme] folder on the server, overwriting the original file.
There is one problem with this approach. In the Comments management section in the Admin area, you will not the person’s name. You will only see their keywords. There is no way around this.
2. Change Your Theme To Use comment_author_link()
This is better than using the Compatibility Mode, but is harder to implement. There is also a chance that your theme doesn’t use comment_author_link() because it does something special using the other technique. DO NOT attempt this unless you are comfortable editing themes.
- Use FTP to go to the wp-content/themes/[yourtheme] folder on your server and download the comments.php file.
- IMPORTANT: Make a copy of the comments.php file so you can put it back if something goes wrong.
-
Edit the comments.php file and find the line that adds the comment author’s name. It normally looks something like this:
<a href="<?php comment_author_url();?>"><?php comment_author();?> </a>
-
Replace this with the following:
<?php comment_author_link() ?>
- Save the file and FTP it up to the wp-content/themes/[yourtheme] folder on the server, overwriting the original file.
NOTE: The problem mentioned in the Compatibility Mode section (names not appearing in Comments management) will not occur with this approach.
3. Decide Not To Use The Plugin
Obviously, I’d like as many people to use the plugin as possible, but if it doesn’t work with your theme and you’re not comfortable with the above options, the last choice to not use KeywordLuv.
Final Thoughts
Hopefully this information will help you decide what action to take. If you need any further information, please contact me and I’ll help you if I can. Thanks for considering KeywordLuv.















We were going to install the plugin, but we hesitated when we saw the warning about potential theme uncompatibility… and now we’ve run out of time. (We’re always getting too sidetracked tweaking our blog when we should be working on other projects.)
At first I thought, well great - but what if it doesn’t work with the next theme I switch to… but then I found this post with your hacks.
I’m sure I’d be able to implement your hacks to make the plugin work… it’s just a question of convenience.
Any possibility of making the switch between author_link and the other versions as easy as clicking a toggle box on an options page? (”If KeyWordLuv doesn’t work with your theme, blah, blah, blah?)
Could you do the same with the dofollow option? (or would that just complicate things with other dofollow plugins. I know you’re trying not to duplicate work, but I wonder about new bloggers who are just learning about plugins. Maybe the thought of adding another plugin would be a limiting factor?)
Last question for you as a plugin developer. We heard running multiple plugins slows the blog down. Would it be better for KeyWord to have that dofollow functionality so we could get rid of our dofollow plugins, or does it not really matter?
I don’t know. Just some thoughts. Good luck.
Mark’s last blog post..You Just Won 5 bucks! - 5 Dollar Comment Contest Winner
Hi Mark.
I should make this clear. If your theme is not compatible, then the only bad thing that will happen is that links containing the @ symbol will look like:
Stephen @ Custom WordPress Plugins Says
instead of:
Stephen from Custom WordPress Plugins Says
It’s hardly the end of the world! I may have played it up a little to much!
Unfortunately there’s no way to automate the hack to incompatible themes. The only way to do it is to manually change the theme. A plugin can’t access the bit which needs to be changed.
Good point about adding DoFollow for new bloggers. I have very limited time at the moment, so it’s unlikely I can do it in the short term, but it is something I’ll consider for the medium term.
Running too many plugins can slow down the blog, because each plugin needs to do its thing. However you wouldn’t really save anything if KeywordLuv was Dofollow and you disabled your current Dofollow plugin. KeywordLuv would just do the work instead. You might save one or two hooks if KeywordLuv was running at that time anyway, but the saving would be miniscule.
Thanks for the thoughts and good luck not getting sidetracked (I know that feeling all too well!).
I do not think it is a problem at all having your name as well as blog title linked in the case of incompatibilities.
I am off to install the plugin myself now but wanted to try your ‘reply to’ feature which is nifty too.