Created
November 18, 2010 17:29
-
-
Save lmullen/705312 to your computer and use it in GitHub Desktop.
Code for a WordPress widget that will display the latest on THATCamp from Twitter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
include_once(ABSPATH . WPINC . '/rss.php'); | |
$rss = fetch_rss('http://search.twitter.com/search.atom?q=thatcamp'); | |
$maxitems = 3; | |
$items = array_slice($rss->items, 0, $maxitems); | |
?> | |
<ul id="twitter"> | |
<?php if (empty($items)) echo '<li>No items</li>'; | |
else | |
foreach ( $items as $item ) : ?> | |
<?php if($item['author_name'] == 'huberthsu (huberthsu)') continue; ?> | |
<li><a href="<?php echo $item['author_uri']; ?>"><img src="<?php echo $item['link_image'] ?>" alt="<?php echo $item['author_name'] ?>" /></a> | |
<p><a href="<?php echo $item['author_uri'] ?>"><?php echo $item['author_name']; ?></a> <?php echo $item['title']; ?></p></li> | |
<?php endforeach; ?> | |
</ul> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment