Title: php Dysplay FB Comments
Last modified: August 21, 2016

---

# php Dysplay FB Comments

 *  Resolved [Patryk](https://wordpress.org/support/users/patrykos360/)
 * (@patrykos360)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/php-dysplay-fb-comments/)
 * Hi, what is the php code to display comments fb?
    like this `<?php facebookall_render_facebook_button();?
   >
 * [http://wordpress.org/extend/plugins/facebookall/](http://wordpress.org/extend/plugins/facebookall/)

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Plugin Author [sourceaddons](https://wordpress.org/support/users/sourceaddons/)
 * (@sourceaddons)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/php-dysplay-fb-comments/#post-3930340)
 * Hi try
    do_shortcode(‘[facebookall_comments]’); Thanks
 *  Thread Starter [Patryk](https://wordpress.org/support/users/patrykos360/)
 * (@patrykos360)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/php-dysplay-fb-comments/#post-3930355)
 * Hi i try ‘<?php do_shortcode(‘[facebookall_comments]’);?>’
 * but sil not work on my page : [http://darkdesign.org/camilla-lackberg-kamieniarz](http://darkdesign.org/camilla-lackberg-kamieniarz)
 * at the bottom of the page on letters:
    Skomentuj na Facebooku
 * some other idea?
 *  Plugin Author [sourceaddons](https://wordpress.org/support/users/sourceaddons/)
 * (@sourceaddons)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/php-dysplay-fb-comments/#post-3930448)
 * Hi,
    please check again in your file or try to add <?php echo facebookall_get_fb_comments();?
   > Thanks
 *  [gpsy1](https://wordpress.org/support/users/gpsy1/)
 * (@gpsy1)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/php-dysplay-fb-comments/#post-3930503)
 * Hi, thanx for the php shortcode but now i have double comment box, how to remove
   the first one???
 *  [gpsy1](https://wordpress.org/support/users/gpsy1/)
 * (@gpsy1)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/php-dysplay-fb-comments/#post-3930504)
 * 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');
       ```
   

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘php Dysplay FB Comments’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/facebookall_3b5997.svg)
 * [Facebook All](https://wordpress.org/plugins/facebookall/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/facebookall/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/facebookall/)
 * [Active Topics](https://wordpress.org/support/plugin/facebookall/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/facebookall/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/facebookall/reviews/)

 * 5 replies
 * 3 participants
 * Last reply from: [gpsy1](https://wordpress.org/support/users/gpsy1/)
 * Last activity: [12 years, 6 months ago](https://wordpress.org/support/topic/php-dysplay-fb-comments/#post-3930504)
 * Status: resolved