Articles
Home | topic: Themes | Twitter without a plugin

Twitter without a plugin

Add your latest twitter stream without a wordpress plugin or Twitter js script, just by using the native WordPress RSS functions file.
Replace fetch_rss(‘http://twitter.com/statuses/user_timeline/1487781.rss’) with your Twitter RSS Feed instead of mine, usually at the bottom of your Twitter page, then check this line $rss->items, 0, 1, where 1 indicates the Twitter messages to show up, replace it with four, then four of your latest messages will show up.

Here is the code:

<?php require_once (ABSPATH . WPINC . ‘/rss-functions.php’); ?>
<?php $today = current_time(‘mysql’, 1); ?>

<?php
$rss = @fetch_rss(‘http://twitter.com/statuses/user_timeline/1487781.rss’);
if ( isset($rss->items) && 0 != count($rss->items) ) {
?>

<?php
$rss->items = array_slice($rss->items, 0, 1);
foreach ($rss->items as $item ) {
?>

<a href=’<?php echo wp_filter_kses($item['link']); ?>’>
<?php echo wp_specialchars($item['title']); ?></a>
<small>—
<?php echo human_time_diff( strtotime($item[’pubdate’], time() ) ); ?><?php _e(’ago’); ?></small>

<?php
}
}
?>


Twitter without a plugin
wp native rss . 1301

on Apr 18

Get support at the forum | Check all my themes at the WordPress page.


Themes

100 free WordPress themes for every purpose. | Archives

milo317¯

is a graphic and web designer based in Munich, who works with clients to create cutting edge web design. View portfolio or read on...

More in Themes (3 of 253 articles)


3oneseven

Echinger str | 80805 Munich | Germany

milo [at] 3oneseven [dot ] com - 3oneseven.com

+49 173 4298898


milo creative

design & strategy

3oneseven is the interactive design portfolio of Munich based designer milo. View portfolio...

solutions

Web design focusing on user experience, brand identity, & best practices for the Web.

get in contact

If you would like to find out more, or get in touch, use my contact form...


Get in contact
  • 3oneseven
  • Echinger str
  • 80805 Munich | Germany
  • T: +49 173 4298898
  • Copyright © 3oneseven
  • All rights reserved.