Edit comments section

Posted in: Newspaper
Post count: 72

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.

Post count: 20688

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

Post count: 72

Hello,
I’ve read the topic… Why we need to adopt that solution? Pros and cons?
Isn’t more effective and fast editing the Newspaper/comments.php directly?

Post count: 20688

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

Post count: 72

Hello,
if I replace all the code in comments.php located in wp_booster with Facebook comment code, which I mentioned above, the mobile theme stops working with the cache plugin enabled.
Does this happen to you?

Thanks.

Post count: 20688

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

Post count: 8

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

Post count: 66

Where do add the code in comment.php (mobile) /wp-content/themes/Newspaper/mobile? Anybody?

Post count: 20688

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

Post count: 66

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]&#8221; data-width=”100%” data-numposts=”5″></div>

Post count: 20688

Hi,

Sorry for misunderstanding. You will have to replace all the code that is present there in the comments file, with the one you mention.

Thanks

Viewing 11 posts - 1 through 11 (of 11 total)
The forum ‘Newspaper’ is closed to new topics and replies.