Show Number of Facebook Likes in PHP

in Programming

If you run a Facebook page, and you are starting to build up some good numbers, you may want to show them off on your website. Facebook allows you to embed a Facebook widget on your homepage, but that means you are using third-party scripts, and you can’t control the design. Here is a simple PHP snippet for displaying your Facebook Likes on your website.


$facebook_page_id = "127012630783508";
$results = @simplexml_load_file("http://api.facebook.com/restserver.php?method=facebook.fql.query&query=SELECT%20fan_count%20FROM%20page%20WHERE%20page_id=${facebook_page_id}");
echo $results->page->fan_count;

Delete WordPress Sample Content Automatically

in WordPress

WordPress ships with 2 pieces of sample content. The Sample Page and a Sample Post content have been part of the WordPress base install for years. I wish WordPress gave an option to install WordPress without sample content, but as far as I know that’s not on the feature map. There may be times when you will need to delete that sample content programatically. Read more

Make War with a multitude of councillors

– Greek Proverb

Track Number of Visits to WordPress Pages and Posts

in WordPress

Almost everyone who has a WordPress site/blog, uses Google Analytics. This great tracking tool gives you insight into your visitors that traditional marketers would only dream of. Sometimes you want to do some things that Google Analytics is not a right fit for. You may want to track which pages or posts are the most popular. Read more

Work Well, Think Hard

– Robert Kiyosaki

2015 Year in Review

in Uncategorized

It’s only natural for everyone to look back at the last year when a new year is about to start. For the last few years, I’ve had some big changes in my life. I got married, bought a house, and had our wonderful son Zachary born into this world. Given all those changes over the last few years, I expected 2015 in be a quiet one. It wasn’t. I think it’s safe to say it’s been the biggest year yet! Read more