Posted by Tawny Press17 December, 2008, 4:02 pm
Category : Blogging / Tips/Tools / Twitter
I was reading TwiTip and realized there was a comment field, to link your twitter address, linking to your Twitter home page. That is a great idea. I searched for a Wordpress Plugin, none was found on Wordpress.org. This worked great until I upgraded to 2.7 and am hoping this plugin will soon be upgraded as well.
To my delight, a few days later ProBlogger, wrote a post on his process. He provided a link to Ideashower, a plugin developer with a method of adding fields into the comment section. Between ProBlogger ’s post and the overview of the developers site I was able to code my comments, fairly simple. If you use Thesis template, ProBloggers post would benefit you.
Here is the process I used. Let me remind you, each Theme is different, so your code may look slightly different. It is also a great idea to make a backup before changing any code, here is a plugin referred by @panah, WP-DB-Backup. I used Dreamweaver to modify my php files and used my “undo” a few times testing this method.
Download the plugin files from the developers site.
Unzip the “Extra-comment-fields” zip file. Upload the file PHP file “extra-comment-fields“ to the /wp-content/plugins/ directory, under your themes directory. This file does not have a folder as do many Plugins available.

In this section, you will be modifying your html code. I am using Dreamweaver as my editor. Open your Comments.php file, usually located in wp-content/themes/yourthemename/comments.php
Part 1
Look for a piece of code similar to the image below. This code may be grouped together with several similar lines, grouped together, with “text” name(s) like comment_author, comment_author_email or comment_author_url or something similar.
When you locate the correct code, copy one entire section, and paste it at the bottom.
Part 2
a.Name =”twitter” (your reference name)
b.Id=”twitter” (Set in Activation & Variable setup A)
c.Value = $comment_extra_twitter; ?>” (refers to plugin & variable set)
d.Twitter ID’,'arthemia’) (“Twitter ID: is the label that will show on your comment form)
e.optional)’,'arthemia’) (“optional” is the label that will show on your comment form)
Once your code is modified, upload your new comment.php page. Go to your blog, view your comment section, it should now have a Twitter ID line for commenter’s to add their Twitter Id.

Part 3
This next step is a method of allowing people to enter their user names with and without the “@” symbol, and continue to link correctly. This piece of code, courtesy of ProBlogger referenced above.
Look for code that looks similar to this:
div class=”commentlist”
Under this section of code, courtesy of ProBloggers post, paste the below code as is:
extra_twitter) {
// Strip out the @ if they put it there because we’re going to need to get rid of it for the url anyway
$extra_twitter = preg_replace(”/^@/”, “”, $comment->extra_twitter);
$extra_twitter = htmlentities($extra_twitter); ?>
”>@
This is such a quick and easy way to locate the commenters blog as well as their Twitter Id, which is as important to me.

Let me just say, I HOPE someone creates a great plugin to add your Twitter ID in the future. Every Theme is different, so please, if you follow this process and find any differences with your theme, please post the work around. I hope this was helpful and simple to understand. Please post a comment if you add it to your blog, so we can see your creativity.
Popularity: 62% [?]
LOL – “I wish I spoke cat and dog”. I’m such a goof sometimes.
I tried this last weekend and it worked fine but I couldn’t decide where to place the twitter username. I spent too much time fussing with it so I decided to leave it until later. I can’t stand it when I obsess about little details like that.
Thanks for the write-up!