WordPress.org

Forums

Facebook
[resolved] Comment box adds extra height whitespace in mobile version (4 posts)

  1. jbx
    Member
    Posted 1 year ago #

    I am trying to include the comment box on the mobile version of my site (which already works fine on the desktop version of my site). I am including the comments box as follows:

    <?php comments_template(); ?>

    It is appearing fine, however it is adding an extra whitespace of 49px (height) for no reason at all. There don't seem to be any settings from where this is coming from. This is only happening when the widget detects a mobile user agent.

    When I did 'inspect element' in Chrome Canary, I noticed that the comment box was 114px (empty comment form with 0 comments), while the outer span containing its iframe was 160px, and there was an extra 3px coming from somewhere else too, making the total height 163px.

    Is there any way to remove this? Its making the page look awful on mobile and I cannot launch with this.

    Thanks.

    https://wordpress.org/plugins/facebook/

  2. Niall Kennedy
    Member
    Plugin Author

    Posted 1 year ago #

    It seems like you might be having an issue with the Facebook Comments Box social plugin and its default CSS. The Facebook Developer site is the best place to get support for specific social plugins as the Facebook Plugin for WordPress has placed the correct markup on the page.
    https://developers.facebook.com/bugs/custom/?tag_ids=228651033836895

  3. jbx
    Member
    Posted 1 year ago #

    Yes, I filed it here too in fact.
    https://developers.facebook.com/bugs/621107951311170/

    Is there any way to override it in the meantime? Seems that some people on Stackoverflow are saying that adding mobile="false" solves the problem and also here.

    I tried to add mobile="false" to the DIVs in social_plugins/comments.php but it didn't have any effect. I am probably modifying the wrong place. Where is the actual markup of the fb-comments div in the plugin?

  4. Niall Kennedy
    Member
    Plugin Author

    Posted 1 year ago #

    Facebook Comments Box parameters are pulled from the facebook_comments option.

    The Facebook_Comments_Box class reads the options array and formats the <div>. Facebook social plugin parameters are data-* attributes.
    https://github.com/facebook/wordpress/blob/master/social-plugins/class-facebook-comments-box.php

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Facebook
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic