2015-09-04 106 views
-1

我有view.phpindex.php。 我實現了在view.php FB評論插件,我想在的index.php獲取Facebook評論插件的評論數

顯示評論數這就是我在view.php

<div class="fb-comments"colorscheme="light" 
data-href="http://www.example.com/'.$product["id"].'" 
data-width="100%" data-numposts="5"></div> 

動態顯示評論框這是我在view.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.4"; 
    fjs.parentNode.insertBefore(js, fjs); 
}(document, 'script', 'facebook-jssdk'));</script> 

頭如何顯示上的index.php評論數?

回答

2

Comments Count插件將幫助你!

按照文檔,每個帖子後你都會有一條評論數。請記住在index.phpview.php標題中也包含您的Facebook代碼!