This is facebookall_share.php im assuming i have to change here something.
* Adding comments.
*/
function facebookall_get_fb_comments() {
$fball_settings = get_option('fball_settings');
if ($fball_settings['enablecomments'] == '1') {
$comment_script = '<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/all.js#xfbml=1&appId='.$fball_settings['comment_appid'].'";
fjs.parentNode.insertBefore(js, fjs);
}(document, "script", "facebook-jssdk"));</script>';
$show_comments = '';
if (!empty($fball_settings['comment_title'])) {
$show_comments .= '<div style="margin:0"><b>'.ucfirst($fball_settings['comment_title']).'</b></div>';
}
if ($fball_settings['comment_color'] == '0') {$colorscheme = 'dark';}
else {$colorscheme = 'light';}
$show_comments .= $comment_script.'<div class="fb-comments" data-href="'. facebookall_get_current_url() .'" data-width="'.$fball_settings['comment_width'].'" data-num-posts="'.$fball_settings['comment_numpost'].'" data-colorscheme="'.$colorscheme.'"></div>';
return $show_comments;
}
else {
$show_comments ="";
return $show_comments;
}
}
/*
* Showing comments.
*/
function facebookall_add_fb_comments($content){
$fball_settings = get_option('fball_settings');
global $post;
$html = facebookall_get_fb_comments();
if((isset( $fball_settings['comment_homepage']) && is_front_page()) || ( isset( $fball_settings['comment_posts'] ) && is_single() ) || ( isset( $fball_settings['comment_pages'] ) && is_page() ) || ( isset( $fball_settings['comment_postecerpts'] ) && has_excerpt() ) || ( isset( $fball_settings['comment_archives'] ) && is_archive() ) || ( isset( $fball_settings['comment_feed'] ) && is_feed() ) ) {
if(isset($fball_settings['comment_top'] ) && isset($fball_settings['comment_bottom'])) {
$content = $html.'<br/>'.$content.'<br/>'.$html;
}
else {
if(isset($fball_settings['comment_top'])){
$content = $html.$content;
}
elseif (isset($fball_settings['comment_bottom'])){
$content = $content.$html;
}
}
}
return $content;
}
add_filter('the_content', 'facebookall_add_fb_comments');