Facebook comments color scheme won't change

2.2k Views Asked by At

Trying to add the official Facebook comments plugin. plugin loads fine but I cannot change the theme or color scheme.

According to Facebook:

colorscheme is one of the settings for the plugin and it's controlled via a custom html5 attribute. That attribute is data-colorscheme.

The color scheme used by the comments plugin. Can be "light" or "dark".

I want the dark color scheme, wouldn't that be data-colorscheme="dark"?

I tried that and it doesn't have any effect.

<div class="fb-comments" data-href="https://developers.facebook.com/docs/plugins/comments#configurator" data-colorscheme="dark" data-href="https://developers.facebook.com/docs/plugins/comments#configurator" data-numposts="5"></div>

here's my full code.

<body>

  <div id="fb-root"></div> <!-- load sdk -->
  <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_GB/sdk.js#xfbml=1&version=v2.10";
      fjs.parentNode.insertBefore(js, fjs);
    }(document, 'script', 'facebook-jssdk'));
  </script>
  
  <div></div> <!-- page content -->
  <div></div> <!-- page content -->
  <div></div> <!-- page content -->
  <div></div> <!-- page content -->
  <div></div> <!-- page content -->
  <div></div> <!-- page content -->
  <div></div> <!-- page content -->
  <div></div> <!-- page content -->
  
  <div class="fb-comments" data-href="https://developers.facebook.com/docs/plugins/comments#configurator" data-colorscheme="dark" data-href="https://developers.facebook.com/docs/plugins/comments#configurator" data-numposts="5"></div> <!-- FB comments with attr data-colorscheme="dark"  -->


</body>

2

There are 2 best solutions below

0
On

You add data-href="" property two times. Please try this:

<section>
    <div class="fb-comments" data-href="{{url absolute="true"}}" data-width="100%" data-colorscheme="dark" data-numposts="5"></div>
</section>
1
On

Instead of

<div class="fb-comments" data-href="https://developers.facebook.com/docs/plugins/comments#configurator" data-colorscheme="dark" data-href="https://developers.facebook.com/docs/plugins/comments#configurator" data-numposts="5"></div>

Try this one

<fb:comments href="https://developers.facebook.com/docs/plugins/comments#configurator" num_posts="5" width="100%" colorscheme="dark"></fb:comments>