Hello,
I need to add the Facebook comments system to the theme. Currently I am using a child theme.
I uploaded the comments.php (Newspaper/includes/wp_booster), with the Facebook comments code, file in my child theme’s root but the theme keeps loading the default comments code. Here is the code I was forced to put in the Newspaper/comments.php file:
<div class="comments" id="comments">
<h4 class="block-title" style="margin-top: 0px;"><span>LASCIA UN COMMENTO</span></h4>
<div class="fb-comments" data-width="100%" data-order-by="social" data-href="<?php the_permalink(); ?>" data-numposts="5" data-colorscheme="light"></div>
</div>
P.S.: I hope this topic is not somehow related to https://forum.tagdiv.com/topic/mobile-theme-stopped-working/
Thanks.
Hi,
Maybe you can find some useful suggestions and solutions in this topic for the Facebook comments
– https://forum.tagdiv.com/topic/facebook-comments-2/ and go over the steps mentioned there, maybe there is something you may have overlooked.
Thanks
Hi,
You can try any method you want, and decide which path to follow for these customizations. I thought you would find the respective topic useful as it is related to what you are trying to achieve. You can make your modifications directly to the theme files, but if you were to update the theme you will lose them.
The theme will load the default comments unless removed or replaced as shown in that topic
– http://www.screencast.com/t/wPRAEUTQrkU for the single post page, or in the comments.php file located in the wp_booster folder.
Thanks
Hi,
That should not happen because the mobile theme has it’s own comments.php file that is uses
– https://www.screencast.com/t/Yz2NvlnCo
Maybe something else is causing this issue, try testing with the the default comments from the main theme, and see if it happens again.
Thanks
its simple:
copy and paste same code scrip facebook like hader.php (theme) /wp-content/themes/Newspaper
<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/pl_PL/sdk.js#xfbml=1&version=v2.9&appId=[ID APP]";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
to
header.php (mobile) /wp-content/themes/Newspaper/mobile the same place
and
comment.php (theme) /wp-content/themes/Newspaper
<div class="fb-comments" data-href="http://www.[YOUR_SITE]" data-width="100%" data-numposts="5"></div>
to
comment.php (mobile) /wp-content/themes/Newspaper/mobile the same place
Hi,
The comments file for the mobile theme is located in the mobile folder, if that is what you are asking
– https://www.screencast.com/t/DuT3z585y4
Please consider making a backup before starting the modifications.
Thanks
You misunderstood me. I know where it is located. I was asking where on comments file do I need to add the code so that fb comments also appear on the mobile version of the app.
More specifically where to add this code:
<div class=”fb-comments” data-href=”http://www.[YOUR_SITE]” data-width=”100%” data-numposts=”5″></div>