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 -
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');
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.