2017-04-14 69 views
-2

我有一个functions.php的循环,从我的wordpress网站如何实现Facebook的评论系统与WordPress的functions.php

显示的帖子,当我尝试Facebook的意见整合,我到的functions.php,他们不会添加某种原因

我包括Facebook的剧本太在functions.php中没有成功

如何进行?

+0

请分享你已经试过的代码。 –

+0

在functions.php我已经包括了脚本和评论代码由Facebook评论 –

+0

您是否尝试使用任何插件的Facebook评论? – Prabu

回答

1

步骤1

pasete下面的代码标签后的header.php

<div id="fb-root"></div> 
    <script>(function(d, s, id) { 
    var js, fjs = d.getElementsByTagName(s)[0]; 
    if (d.getElementById(id)) return; 
    js = d.createElement(s); js.id = id; 
    js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.8"; 
    fjs.parentNode.insertBefore(js, fjs); 
    }(document, 'script', 'facebook-jssdk'));</script> 

第2步:

粘贴下面的代码要apear如单Facebook的评论。 php

<div class="fb-comments" data-href="<?php the_permalink(); ?>" data-width="100%" data-numposts="10" data-order-by="social" data-colorscheme="light"></div> 

希望它能为你工作。

+0

如何在functions.php中做到这一点? –

+0

查看截图在这里http://prntscr.com/ewaccy –

+0

它正在与single.php但不能与functions.php –