Best 2 Know

The Ultimate Blogging Resource

  • Advertising
  • WebHosting
  • Contact Us
  • Blogger
    • Blogger Templates
    • Blogger Tutorials
  • Browser
    • Firefox
    • Google Chrome
  • Google
  • Internet
    • Facebook
    • Twitter
  • Thesis
  • Windows
  • WordPress
    • WordPress Themes
    • WordPress Plugins
  • More
    • Linux
    • Review
    • Solutions
    • Announcements

Display number of Facebook fans in full text on your WordPress blog

If you have a Facebook fan page for your blog, you might want to display how many facebook fans you have. Today’s I will help you to get your Facebook fan count, in full text!

For displaying Facebook fan Count you just have to add the below code anywhere in your theme :

<?php
	$page_id = "YOUR PAGE-ID";
	$xml = @simplexml_load_file("http://api.facebook.com/restserver.php?method=facebook.fql.query&query=SELECT%20fan_count%20FROM%20page%20WHERE%20page_id=".$page_id."") or die ("a lot");
	$fans = $xml->page->fan_count;
	echo $fans;
?>

Change the YOUR PAGE-ID on line 2

Subscribe via Email

Share this:

  • Twitter
  • Facebook
  • Pocket
  • Print
  • WhatsApp
  • Email

Related

January 20, 2012 Ritesh Sanap WordPress blog, FaceBook, Facebook fans, Tricks, wordpress hacks

Comments

  1. leiva says

    November 5, 2012 at 10:08 pm

    any demo? can I show: Join our n fans on facebook!?

    Reply
    • Ritesh Sanap says

      November 21, 2012 at 12:35 pm

      Well it completely depends on your creativity the code provided is the base code

      Reply
      • leiva says

        November 26, 2012 at 12:15 am

        heres my demo: http://osmanleiva.com/fans.php

        Reply
        • Ritesh Sanap says

          November 26, 2012 at 7:09 pm

          Looks Great, but might look more awesome when using on a WP site in action

          Reply

Leave a Reply Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Post navigation

Previous Previous post: Three Must-Have Plugins for Marketing Your WordPress Blog
Next Next post: Yet Another Related Posts Plugin ( YARPP ) shows double results

Currently Trending

  • How to download Specific parts of YouTube videos
  • How to Change the Welcome/Login Screen in Windows XP ?
  • Windows Vista CD key
  • HTTP2 Server Push for W3 Total Cache Minify plugin
  • Embed Text Resizing Widget To Increase or Decrease The Font Size
  • Free Online Angry Birds game
  • Different way’s to shutdown your pc
  • Check if your Antivirus Is Working Properly
  • Free Online Virus and Malware Scan
  • NTFS vs. FAT

Get Latest post in your Inbox

Random Posts

From Netbook to Jetbook- Make your notebook super fast

March 14, 2009 By Ritesh Sanap 5 Comments

Converting a Folder into a Drive

August 8, 2008 By Ritesh Sanap Leave a Comment

Related Post Plugin for wordpress

November 22, 2010 By Ritesh Sanap 2 Comments

Facebook Like or Recommend Button For Blogger

May 24, 2010 By Ritesh Sanap 4 Comments

Blogger’s New "Reactions" Feature – How to add to customized blog templates

August 16, 2008 By Ritesh Sanap 1 Comment

WordPress

HTTP2 Server Push for W3 Total Cache Minify plugin

August 17, 2016 By Ritesh Sanap 5 Comments

How to Disable Emojis in WordPress

January 6, 2016 By Ritesh Sanap Leave a Comment

JetPack Related posts and Sharing not working with NGINX

November 10, 2015 By Ritesh Sanap Leave a Comment

Simply Pure – WordPress Theme

November 2, 2014 By Ritesh Sanap 2 Comments

Advanced What should we Write about next? – WordPress Plugin

July 28, 2014 By Ritesh Sanap Leave a Comment

How to Disable Self Pingback or TrackBack

January 16, 2014 By Ritesh Sanap Leave a Comment

BlueStrap – WordPress Theme

January 1, 2014 By Ritesh Sanap 15 Comments

How to Create Multiple Excerpts in WordPress

December 24, 2013 By Ritesh Sanap Leave a Comment

How to Disable Auto Update in WordPress

November 21, 2013 By Ritesh Sanap Leave a Comment

How to Delete Feedbacks from JetPack Contact Form

November 19, 2013 By Ritesh Sanap 9 Comments

Recent Posts

  • HTTP2 Server Push for W3 Total Cache Minify plugin
  • How to show hidden files and folders in Mac OS X
  • How to Disable Emojis in WordPress
  • Canva – Online Photo Editor
  • JetPack Related posts and Sharing not working with NGINX

Archives

Recommends

  • DigitalOcean – Cloud Hosting
  • Dropbox – Cloud Storage
  • Elegant Themes – WordPress Themes
  • LastPass – Password Manager
  • Like us on Facebook
  • Follow on Twitter
  • +1 on Google
  • Subscribe via Email
  • RSS Feed

© 2023 Best 2 Know · All Rights Reserved · We ♥ DigitalOcean