HomeWordpress → WP Twitip ID Light Reloaded

WP Twitip ID Light Reloaded

Now that I am a twitterer I have decided to integrate twitter into my theme. I decided to install WP-Twitip-ID which adds a form field into your comments template, stores the twitter id that is entered and then displays the corresponding twitter ID within the comments.

Why change it?

While this is an excellent script I didn’t need all of the functions. By trimming the plugin, creating the twitter ID form field manually and adding 1 simple function to my theme I have removed unnecessary code.

Twitip ID light

Download & Install Plugin

Download the plugin found here. Install it into your plugins folder in wp-content or use the admin upload tool. Activate the plugin.

Edit Comments Template

In comments.php look for a line beginning with the following. It may look slightly different.

1
2
3
4
5
6
7
8
<input id="author" name="author" size="22" type="text" value="<?php echo $comment_author; ?>" tabindex="1" />
<label for="author"><strong>Name</strong>(Required)</label>

<input id="email" name="email" size="22" type="text" value="<?php echo $comment_author_email;?>" tabindex="2" />
<label for="email"><strong>Email</strong>(Required)(Will not be published)</label>

<input id="url" name="url" size="22" type="text" value="<?php echo $comment_author_url; ?>" tabindex="3" />
<label for="url"><strong>Website</strong></label>

Now you want to enter the form field for the twitter id. I entered mine underneath the URL field keeping to the same style as the previous fields.

1
2
<input id="atf_twitter_id" name="atf_twitter_id" size="22" type="text" tabindex="4" />
<label for="atf_twitter_id"><strong>Twitter</strong></label>

Now you want to add the function that will insert the users twitter id with their comment. Now look for the similar in your comments.php. If you cant find it in that file check functions.php as you might have custom comments.

1
2
3
4
<?php echo get_avatar($comment,$size='75',$default='<path_to_url>' ); ?>
<?php comment_author_link() ?>
<?php comment_date('jS F Y') ?><?php edit_comment_link('Edit','','')?>
<!--Twitter ID goes here-->

Twitip Comment ID
As you can see in my comments section the twitter id is below the date, which is line 3 in the above code. Visualise where you would like your twitter id to be displayed within your theme and enter the following.

1
<?php if (function_exists(wp_twitip_id_show)){wp_twitip_id_show('');}?>

The only thing now left for you to do is style your form field using the following id within your stylesheet. You may have the form id elements #author,#email and #url already defined and styled in your stylesheet. Just add #atf_twitter_id to make them all the same.

1
2
3
4
5
#author, #email, #url, #atf_twitter_id
{
height:30px;
margin-bottom:15px;
}

If you want to style the @twitter id output then use the following class.

1
.twitter{}

I hope you have found this tutorial straightforward. Please let me know if you have any troubles

Share

Enjoyed this article? Then recommend it to your friends

               

9 Responses to “WP Twitip ID Light Reloaded”

  1. great post, thank you very much for sharing!

  2. Finally, a solution that works! I’ve been trying to implement something like this for days.

    Thanks for the guide.

  3. coooooooool post,thank you for sharing

  4. thx…good work…i changed…very cool

  5. Tracy

    @dloose Registered users can log out first and then fill out the form out with there twitter id and corresponding email address.

  6. Very cool but not very useful for registered users.

  7. Tracy

    @psrihari Have you installed the original version from the original author or my reloaded version?

  8. I installed the plugin on my blog now and for some reason, the settings page keep loading forever when i try to save the changes i made !

  9. Excellent! Thanks for taking the time to share!

    I noticed this plugin being used at http://davidairey.com and did a quick search based on the id of the field it added to find the source. Your article was conveniently posted at the top!

Leave a Reply

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

*

* Copy this password:

* Type or paste password here:

4,942 Spam Comments Blocked so far by Spam Free Wordpress

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>