Twitter @Anywhere Intergration For Wordpress 3.0
Posted on Fri 18th Jun 2010 · Development · 0 Comments
Just playing to try learn more about WordPress as I have taken a drastic disliking to it as of recent, which is probably due to the fact I haven't really given it the time of day so far.
This adds javascript to your header that will activate Twitters @Anywhere API stuff and also add hovercards.
<?php
/*
Plugin Name: Twitter @Anywhere
Description: Add Twitters @Anywhere to Wordpress 3.0
Version: 0.1
Author: Paul Fraser
Plugin URI: http://www.paulOr.net
Author URI: http://www.paulOr.net
*/
function add_twitter_anywhere() {
echo '<script type="text/javascript" src="http://platform.twitter.com/anywhere.js?id=<-- API KEY -->&v=1"></script>'."\n";
echo '<script type="text/javascript">'."\n\t";
echo 'twttr.anywhere(function(twitter) {'."\n\t";
echo 'twitter.hovercards();'."\n";
echo '});'."\n";
echo '</script>'."\n";
}
add_action( 'wp_head', 'add_twitter_anywhere' );
?>
Remember and add your API key...