
Yesterday, I was just playing with Thesis code and found a very useful hack to add twitter field in the comment section of any WordPress theme.
If you put twitter field in the comment section of your blog then it would be easy to maintain a blogger-reader relationship, and it would also give good visibility to reader’s twitter profile.
Here’s how you can add twitter field on your blog -
For Thesis theme:
1. Install WP Twitip ID plugin on blog.
2. Go to Control Panel.
3. Open custom_functions.php from given path.
/wp-content/themes/thesis/custom/custom_functions.php
4. Copy the following code and paste it in above file.
function custom_Twitter_ID()
{
if(function_exists(wp_twitip_id_show))
{
$atf_id= wp_twitip_id_show("return");
if($atf_id)
{
echo 'Twitter id: <a href="http://twitter.com/',$atf_id,'">@',$atf_id,'</a>';
}
}
}
add_action('thesis_hook_after_comment_meta', 'custom_Twitter_ID');
5. Save the file and open WordPress dashboard.
6. Go to Settings, open WP Twitip ID.
7. Just add an extra <br /> in HTML before Field.
8. Click on update. That’s it!
For normal themes:
1. Get a WP Twitip ID plugin and install it properly on blog.
2. After the installation, go to Theme Editor and open comments.php
3. Put the following code in comments.php
<?php if(function_exists(wp_twitip_id_show)) { wp_twitip_id_show("auto"); }?>
4. Save the file and check your comment section.
I hope you will try this hack in your Thesis theme. If you find any difficulty, just ask me and I’ll try to solve it for you.
Related posts:
{ 15 comments }
That’s a nice hack. I’ll try it out on my blog with Thesis theme.
Yes. You should try it on your blog.
great plugin, it works!
Nice tutorial.
I saw similar field on Harsh blog shoutmeloud.com.
NOw i know how to add this.
BTW, when did you switch to thesis theme?
Does thesis theme also have other colors other than this black and white?
I bought this thesis theme last month. There is no other color combination available in this theme, but you can customize it using several hacks.
Check these wonderful websites which are using customized thesis theme – http://diythemes.com/thesis/showcase/
Thanks for this hack. I have not yet bought the Thesis theme, but I am thinking of this and you have made it very simple to implement twitter into the theme.
Thanks for sharing this info
You’re welcome. Keep visiting for more useful hacks.
Thank you for this!
You’re welcome. Keep visiting for more tips & tricks.
Any tips on how to do this with just a custom text field? I have created the key and the field in the comments form, but I can’t get it to display in the user’s comments under their meta data.
Use twitip plugin, it will solve your problem.
I can use that plugin for something that’s not a twitter ID?
No you can’t use that plugin for any other field.
Right, so really, using twitip WON’T solve my problem, will it?
For customized text field, you’ll have to write a piece of code in comments.php.
I would suggest you to hire a web programmer.
Comments on this entry are closed.