Blog

May 9, 2009

How to Add Twitter Field in the Comment Section of Thesis Theme?


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 -

twitter field

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. :)







19 Comments


  1. That’s a nice hack. I’ll try it out on my blog with Thesis theme.


  2. great plugin, it works!


  3. 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?


  4. George Serradinho

    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 :)


  5. Dave

    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.


  6. Dave

    I can use that plugin for something that’s not a twitter ID?


  7. Dave

    Right, so really, using twitip WON’T solve my problem, will it?


  8. [...] How to add Twitter Field in the Comment Section of Thesis Theme? [...]


  9. [...] customization is not as easy as it sounds. I have written tutorials on how to add twitter field and how to add favicon in Thesis theme, which requires technical knowledge of WordPress. Today, I [...]


  10. its not working on my site…when i try to publish comment, it didnt show anything



Leave a Reply

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

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>