Support Forum
Wondering if there is a way to add Facebook comments in a post? Have done this in the past by using a plugin and pasting it's shortcode under a post.
Ditched the plugin and added fb-comments manually in my theme that works great. However i need to add this snippet in one of SimplePress template files to enable that function.
Poked around in the reboot theme files but not sure which file or where in the file to add this.
- Doc ~ An old Fidonet SysOp. Just hanging out in cyberspace keeping up with tech.
Well - the correct template will be the Topic View (one in the Desktop folder and one in the Mobile folder).
But where exactly do you want to place this so I can be more precise?
Does it work by listening for the class (fb-comments)?
Oh - and you will have to change the href argument as well but I can tell you what to use when I understand the location better.
YELLOW
SWORDFISH
|
It should be inserted right after the first post in the text area.
It pulls a comment app from Facebook allowing fb members to comment and optionally post their comment to their fb profile with a link to visit the topic.
I have it just above my blog post comments so either may be commented on.
- Doc ~ An old Fidonet SysOp. Just hanging out in cyberspace keeping up with tech.
Let's try this - although please remember I can not test this so anything could happen! Find the line of code in the topic view template(s) that corresponds to:
if (sp_has_posts()) : while (sp_loop_posts()) : sp_the_post();
and immediately after that and before the comment about starting the post section add the new bit in the following code:
if (sp_has_posts()) : while (sp_loop_posts()) : sp_the_post(); if ($spThisPost->post_index > 1) { echo ('<div class="fb-comments" data-href="'.$spThisTopic->topic_permalink.'" data-width="100%" data-numposts="10" data-order-by="social" data-colorscheme="light"></div>'); }
see of that works for you...
(Just in case - although I am sure you know - use the 'Raw Code' button and copy the code from the popup window.)
YELLOW
SWORDFISH
|
Hi Andy, nope that didn't work.. Though i did see a big white space between several existing posts.
Assuming the ideal position would be in the 1st post content immediately after the text. That way anyone wanting to comment using their Facebook act could do so only in the 1st post. Other posts to the thread would be using the forum itself.
Probably a good idea for a SP plugin to add this functionality. Just need this snippete added to the head section.
Thanks again for your help..
- Doc ~ An old Fidonet SysOp. Just hanging out in cyberspace keeping up with tech.
So are you saying that supporting javascript is not being loaded by this plugin? Is that because the forum uses a page and the plugin only applies the script to WP posts?
Getting this into the header is no real problem but it still doesn't look to me like that is enough. There must be another component to this I would have thought.
YELLOW
SWORDFISH
|
All that is needed is those two snoppets, and creating the app on Facebook developers site. The app is connected to the sites domain. Don't matter if it's a post or page, just have to pull the post url. That could a problem with sp since it's not a wordpress standard permalink.
- Doc ~ An old Fidonet SysOp. Just hanging out in cyberspace keeping up with tech.
1 Guest(s)