gseeker
如何在WPMU单主题使用Google Friend Connect
将文章归档于 G技巧 由. Hong Xiaowan on 2008-12-06
我的两个博客hongxiaowan.comcn.hongxiaowan.com是建立在WPMU(WordPress多用户版)上面的,而且使用的是一个模板,这时候,使用Google Friend Connect,需要修改Google官方提供的代码:

1.在官方代码前面加上如下代码,把下面代码中的域名换成你自己的,div码,site码也改成你自己的,你有多少个博客,就可以多申请几个代码:

<!- WPMU case ->
<?php
$host = $_SERVER['HTTP_HOST'];
switch($_SERVER['HTTP_HOST'])
  {
    case "hongxiaowan.com":
      $google_friend_div_tag_id = 'div-1228451715983';
      $google_friend_site = '09285935006704218238';
      break;
    case "cn.hongxiaowan.com":
      $google_friend_div_tag_id = 'div-1228452389862';
      $google_friend_site = '08342870974889178639';
      break;
  }
?>


2.找到div-xxxxxxxxxxxxx ,改成<?php echo $google_friend_div_tag_id; ?>,在谷歌的官方代码中有两处;

3.找到site: 'xxxxxxxxxxxxxxxxxxxx',改成site: '<?php echo $google_friend_site; ?>',在谷歌的官方代码中第二个div-xxxxxxxxxxxxx的下面,只有一处。

然后把这个代码加到你的博客主题中,就OK了。

申请代码在:Google Friend Connect

范例在:hongxiaowan.comcn.hongxiaowan.com

Permalink: 如何在WPMU单主题使用Google Friend Connect
img Addthis img Ask img Blinklist img del.icio.us img Digg img Fark img Facebook img Google img Lycos img Ma.gnolia Add this page to Mister Wong Mr Wong img Netscape img Netvousz img Newsvine img Reddit img StumbleUpon img Slashdot img Tailrank img Technorati img Wink img Yahoo

Vote for 如何在WPMU单主题使用Google Friend Connect:

  • Currently 5.50/10
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
分值情况: 5.50 / 4 评分
 
Share It
CW工具栏安设
RSSrss   | 所有的部落格订阅选择
Google google   |   什么是RSS?
Yodao Yodao
Netvibes Netvibes
AnothrAnothr
TwitterFollow us on Twitter!