Using facebook comments plugin and changing the default location

Posted in: Newspaper
Post count: 60

Was reading in another thread about using fb comments plugin: https://wordpress.org/plugins/facebook-comments-plugin/

but I’d like to move the location of where the fb comments appear to directly below the article. The plugin allows for the shortcode [fbcomments]

You can also insert the comment box as a shortcode into any post, page or template and use your own settings for each time you do it! Simply use the shortcode [fbcomments]

however when I try to add it to loop-single-5.php for example, it just prints the words [fbcomments] where I want the comments to appear. Do I need to add it to single_template_1.php?

http://screencast.com/t/9uoWD9tIXeP

Is there a better way to directly add fb comments to newspaper? If I generate the code on https://developers.facebook.com/docs/plugins/comments#configurator it gives me the facebook sdk to add to “ideally right after the opening <body> tag.” and then add

<div class="fb-comments" data-href="http://developers.facebook.com/docs/plugins/comments/" data-width="100%" data-numposts="5"></div>

Thanks!

Post count: 1291

Hi,

You have to use the do_shortcode() function, ex: – http://screencast.com/t/hiReGi3XIIiI

<?php echo do_shortcode('[fbcomments]'); ?>

From your image i see you also have a widget with news From The Web, i suspect it comes from a plugin and it’s automatically placed at the end of the content. If you want a custom position you have to check the plugin documentation.

The Facebook plugin documentation can be found here – http://peadig.com/wordpress-plugins/facebook-comments/ – you can see that it explains how to add it on a template – http://screencast.com/t/mcVunQvadc – you have to look for similar info about the plugin which displays the From The Web widget.

Thank you!

  • This reply was modified 10 years by Emil G.
  • This reply was modified 10 years by Emil G.
Post count: 60

Emil the doesn’t come from the plugin, it’s Taboola and I directly placed it in the file. Is that a bad thing?

I know each time I update the theme I’m going to have to make these adjustments to all the files, is there a better way to manage it?

Post count: 7909

Hi,

You can use it in the code without any issues if you want that(referring to Taboola).
Also you can do the same with the fb comments shortcode like Emil suggested above, just use do_shortcode function in the post template file that you use – http://screencast.com/t/0QxLVm3F23
A solution for your modifications to not be overwritten would be child theme, here you can read more about it(also the supported files) – https://forum.tagdiv.com/the-child-theme-support-tutorial/

Thanks!

Viewing 4 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic.