Posts Tagged ‘External’

Automatically Shorten your Permalink using Bit.ly services

June 5th, 2010 By WP Tricks Posted in Tricks

WordPress Beginner show nicely tutorial about How To Automatically Shorten your Permalink using Bit.ly services. Why we need to shorten our URL? Shorten URL is good to share on many social web, social news, social media and social network such as Twitter, Facebook, Digg and many more..

Shorten your Permalink using Bit.ly - Marie Digby Photo

Shorten your Permalink using Bit.ly - Marie Digby Photo


Read the rest of this entry »

Tricks: Display Total Twitter Followers as Text on WordPress

December 28th, 2009 By WP Tricks Posted in Tips

Everybody blogging everybody using Twitter for Microbloging tools. On this tips, I will show you how to display your total twitter followers on your sidebar or whatever and displaying as text. All need to do is add little bit code on your header.php or footer.php or sidebar.php files. and done.

Please remember to make sure that you change WPTricksNet to your username. To Display Total Twitter Followers as Text, you need to write this code below

<?php
$tw = get_option("twitterfollowerscount");
if ($tw['lastcheck'] < ( mktime() – 3600 ) )
{
$xml=file_get_contents('http://twitter.com/users/show.xml?screen_name=WPTricksNet');
if (preg_match('/followers_count>(.*)</',$xml,$match)!=0) {
$tw['count'] = $match[1];
}
$tw['lastcheck'] = mktime();
update_option("twitterfollowerscount",$tw);
}
echo $tw['count'];
?>

Thanks for WP Recipes for share this code, we got this nice tips via WP Beginner

How To Display External RSS Feeds

December 25th, 2009 By WP Tricks Posted in Tricks

On our recent post, we have write about WordPress Feed Tricks, Right now we will do something else. Sometime we have another useful resource about our blog, some of them really interesting and we need to put the content on Sidebar. With little bit code and tweak, we can made it on our WordPress. How To Display External RSS Feeds on our WordPress is easy.

There are so many method to display External Feeds, we can using RSS Widget, or write our own code. On this tips, we use some WordPress functions and make it smoothly on our WordPress Read the rest of this entry »

Display Latest Tweets on Your WordPress

December 22nd, 2009 By WP Tricks Posted in Tips

Twitter is phenomenal, almost every internet user have this account, they share everything in Twitter. There are so many method how to display Latest Twitter on your WordPress, we can use display as simple rss, using Twitter Widget or using much advantage method to display twitter. On this Tutorial, I will show you how to display your latest twits with more sophisticated method.

Open your sidebar.php theme (if you want display this tweet on your sidebar) and write this code below

<div class="latest-twit">
<?php
$feedURL = "http://twitter.com/statuses/user_timeline/68559295.rss" // change to your feed URL
$doc = new DOMDocument();
$doc->load($feedURL);
$arrFeeds = array();
foreach ($doc->getElementsByTagName('item') as $node) {
    $itemRSS = array (
        'title' => $node->getElementsByTagName('title')->item(0)->nodeValue,
        );
    array_push($arrFeeds, $itemRSS);
}
$limit = 5;
for($x=0;$x<$limit;$x++) {
    $title = str_replace('bavotasan: ', '', $arrFeeds[$x]['title']);
    $str = ereg_replace("[[:alpha:]]+://[^<>[:space:]]+[[:alnum:]/]","<a href=\"\\0\">\\0</a>", $title);
    $pattern = '/[#|@][^\s]*/';
    preg_match_all($pattern, $str, $matches);

    foreach($matches[0] as $keyword) {
        $keyword = str_replace(")","",$keyword);
        $link = str_replace("#","%23",$keyword);
        $link = str_replace("@","",$keyword);
        if(strstr($keyword,"@")) {
            $search = "<a href=\"http://twitter.com/$link\">$keyword</a>";
        } else {
            $link = urlencode($link);
            $search = "<a href=\"http://twitter.com/#search?q=$link\" class=\"grey\">$keyword</a>";
        }
        $str = str_replace($keyword, $search, $str);
    }
    echo '<li>'.$str.'</li>';
}
?>
</div>

That’s all and you can made some custom on this design by play around with your css skills. Thanks for Batovasan for share this code. If you have better idea how to display latest tweets in WordPress please let’s me know