Read Articles

This is default featured post 1 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured post 2 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured post 3 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured post 4 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured post 5 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

Showing posts with label Add HTML facebook on site. Show all posts
Showing posts with label Add HTML facebook on site. Show all posts

Thursday, 7 October 2010

Adding to Wordpress Template

Adding to Wordpress Template

In Wordpress you need to make the same changes as above, but these need to go into the Wordpress templates. You can also add a small amount of wordpress php code to ensure that each blog entry has it's own comment field.

This is all done in the theme for the site, and as such will be propagated across all relevant posts / pages depending upon which you update. You may want to create your own theme and edit that rather than the original, but you can just edit the original.

From the administration dashboard go to "Appearance" and "Editor", then choose the appropriate theme.

You then need to select the appropriate template file.

header.php (Header)
The xmlns tag should be entered within this template file.

footer.php (Footer)
You should insert the JavaScript code for the bottom of the page in this file.

single.php (Single Post) and/or page.php (Page Template)
These template files are used for blog posts and wordpress pages respectively. Update either or both of these depending upon which pages you would like to add your Facebook plugin to.

To include the individual post ID (eg. for the comment unique code) then add:

For example in my single.php file I have inserted the following just before the wordpress comments section:

"> ?>

Add some xfbml content

Add some xfbml content

Now it's time to add some xfbml content. This should be inserted as raw html code wherever you want it to appear in your page. A couple of examples are shown below.

Like button
urlofwebpage">
Replace the url of webpage as appropriate

Comments
unique_id">
Note that the unique_id should be unique for each separate comment thread you want.

You can find more social plugins on the Facebook developers social plugins page

You then need to repeat for any other pages that you want to add these features to.

Adding the Facebook JavaScript SDK to your site

Adding the Facebook JavaScript SDK to your site

To add this functionality you will need to update your web page html code. This will depend upon how you create your web pages as to how you add this. If you are using Dreamweaver you should switch to the code view; using Wordpress see later in this post; using a template based system you will need to edit the templates through a template editor; any other system you need to look for a source code edit feature.

Now start at the top of the page and look for an entity starting and add xmlns:fb="http://www.facebook.com/2008/fbml" at the end of the entity (before the closing angle bracket >). If you don't have an xmlns tag then create one as follows:

xmlns:fb="http://www.facebook.com/2008/fbml">

Now go down to the very bottom of the page and insert the following just before the tag: You will need to change the appID to the one provided when you register your application. Note you could instead copy and paste this section of code directly from the example that Facebook provides when you register.


Enabling Facebook Connect XFBML

Enabling Facebook Connect XFBML

There are a couple of different ways of embedding Facebook content into a website. I've chosen to use the JavaScript SDK with XFBML which incorporates the Facebook Markup Language into the page's HTML. This sounds quite scary, but is in fact a simple way of embedding the features using only a minimal amount of code. If you are not familiar with what html code is or what it looks like then you may want to learn some html before continuing (see book review HTML, XHTML & CSS Sixth Edition, by Elzabeth Castro).

The JavaScript SDK is a chunk of JavaScript code that is downloaded to your visitor's browser and converts the XFBML tags into code that your web browser can understand.

The first step to using the JavaScript SDK is to register as an application with Facebook. We won't actually be creating an application as such, but it means that you will be allocated an Application ID which is needed to allow your site to use the SDK.

Register as a Facebook application developer here.

Enter an "application name" and you will then be provided with the following information along with an example page. It's the unique App ID we are interested in here.

App name: yoursitename
App URL: http://www.yourwebsite.com
App ID: 123123123123
App secret:123123123123

Adding Facebook Social Plug in

I've used the Facebook Connect social plugins to provide a comments feature to my website blogs (see: Blog comments using Facebook connect social plugins).

The reason I added this was because of the way that I create my blog. I use Wordpress as my blog engine running on my WatkissOnline web server, but then depending upon the category, some of the posts are exported to the First Aid Quiz (Health, Safety and First Aid related) website and some to the PenguinTutor.com (Linux, computer and technology related) website. This works well except for one feature, the comments are not available except on the main Wordpress site. Technically it would be possible to show the comments and even to create a proxy system to submit comments, but this would need a significant amount of time to develop properly. So I looked at what other options were available and came across Facebook Connect. This provides a number of facebook social networking features that can be integrated into other web sites.

There are a number of advantages to using Facebook such as:

  • Easy to add to your web site (only a few lines of code)
  • No additional data protection regulations (Facebook is responsible for those)
  • Encourages other Facebook users to know and engage with your web site

It is the last of these that is very appealing.

There are some downsides as well such as:

  • Lack of direct ownership of the comments
  • Does not directly build your potential customer base - although creates alternative in form of "fans"
  • It is only going to be as good as how well your users trust Facebook (which is working at alaying fears over privicy at the moment)

I believe that the potential benefits more than out way the negative aspects.

free counters

Categories

Blog File Sharing Troubleshooting all Computer Troubleshooting How to Operating System Internet Maintanance and Repair ERROR Solutions Help Support Help and Support Device Manager Error Computer Windows Device Applications Install Java Script Computer Repair Java Programe Photoshop Add HTML facebook on site Computer Management Facebook and Site Messenger and Chat Protect Your Computer XFBML and HTML Facebook BELAJAR PHOTOSHOP Shortcut Startup Programs TUTORIAL PHOTOSHOP Windows Administration Tools Create DVD Create DVD Maker Keyboard Network Set Up Security Security System Test DVD Test DVD Drive VGA Card VGA Conector VGA Informations CA-CLIPPER INTERNAL ERROR Crack Create PDF Create PDF using Smart PDF Creator Error windows explorer Hard Drive Partitioning Intall Windows 7 Ultimates Internet Browser Local Area Network Networking PDF EDITOR Protect CD from Copy Router Smart PDF Creator Tutorial Java USB REMOVE Word Password Remover Access Media Collection Adsense Animator Anomymity Computer Hang Computer Icon Computer Set Up D-Link D-Link Router DNS DVD Drive DVD compress Device Drive partitions Drive parts Earn Money Easy Gif Animator Elastomer Eror Solution External Hard Drive Facebook Free Internet Hack Password Hard Drive How to Download Inside Adsense Internet Explore JPEG JPG GIF PNG BMP Laptop Laptop vs PC MS Word to PDF Make DVD Make Money with blog Make Your Own Copy-Protected CD with Passive Protection Modem Ms Word Applications Online Shoping PC Desktop PDF Remover Partitions drive Picture Prevent Windows XP Print Printer Error Reboot Application Remove Pasword Excel Restore Windows Registry Search Engines Optimizer Social Networking Solving Probelm System Registry Upload File to blogger Upload Files Virtual Memory is to Low Viture Windows 7 Windows DVD Maker Wireless Wireless router Words error intall windows explorer cannot open words documents cannot open

Share

Twitter Delicious Facebook Digg Stumbleupon Favorites More