Wordpress Plugins – Extensions

Just another WordPress.com weblog

AJAXed Twitter for WordPress 0.5

Author: Alexander Hofbauer
This plugin is based on “Twitter for WordPress” 1.9.7 by Ricardo González
Installation:
You can use this plugin as a widget or add it manually to your theme. In widget-mode it depends on jQuery (the one that comes with WordPress is sufficient).

Widget

Use the management functionality for widgets provided by WordPress (simply drag and drop, edit the preferences, save).

Manual Installation

First of all tell the plugin (in wp_config.php) which framework to use:

define(‘AJAXED_TWITTER_FRAMEWORK’, ‘mootools’);

You can also use ‘both’ which will allow you to add a widget and the MooTools version.

I did not include a release of MooTools, so you will have to add a script tag before wp_head(); like this (and of course provide that script there):

<script type=”text/javascript” src=”<?php bloginfo(‘stylesheet_directory’); ?>/scripts/mootools-1.2.4-core-yc.js”></script>

Then you need a PHP-file that can be called by the JavaScript part, for example you could put a file named “twitter.php” with the following content in your theme folder. This is only an example and you can do whatever you like to get the tweets.

if (!defined(‘DB_NAME’)) {
require_once(“../../../wp-config.php”);
}

echo AJAXedTwitter::messages(array(
‘username’ => ‘username’
));

The Twitter-class is easy to configure (and already enqueued by the plugin).

var twitter = new Twitter(‘tweets’, {
url: ‘/blog/wp-content/themes/yourtheme/twitter.php’,
retries: 2,
animate: true
});

In this example the element ‘tweets’ (that could be e.g. in your sidebar) is replaced by a public timeline after the page is loaded.

Additionally to the CSS classes provided by “Twitter for WordPress” this plugins provides first/last for list items.

For more details (options, configuration) visit the plugin hompage.

AJAXed Twitter for WordPress 0.5

Advertisements

June 6, 2010 - Posted by | download, extension, extensions, free, get, internet, plugin, plugins, Uncategorized, wordpress

No comments yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: