How to show correct number of Facebook comments on frontpage?
-
Hi everyone,
My site: https://agffan.dk/
I have started to use Facebook’s own “Comments plugin”, were I get a code to put into my site. I have placed it in my “comments.php”-file and deleted the original commenting system, so the Facebook-thing is shown on all my “single.php”-pages.
Another code in my comments.php is:
<div class="comment-count"> <a href="#comments"><fb:comments-count href=<?php the_permalink() ?>></fb:comments-count> kommentar(er) </a></div>
This shows the number of comments made in the Facebook “plugin”. This works fine after I put in “<?php the_permalink() ?>” so it only counts comments on that specific page.
My problem appears on my frontpage, were the number of comments also have to be shown. The code to show number of comments is originally:
<div class="comment-count"> <?php comments_popup_link( __( '0 kommentarer' ),__( '1 kommentar' ), __( '% kommentarer' )); ?>
But I want it to show number of Facebook-comments, so I put in another code:
<div class="comment-count"> <?php comments_popup_link(<fb:comments-count href=XXX></fb:comments-count> comments ); ?>
I just don’t know what to put in instead of the XXX, to make it show the actual number of comments on the page were the comment-plugin is placed. “<?php the_permalink() ?>” referes to the frontpage, so that doesn’t work! ??
What to do?
Thank you very much!
Best regards,
Tobias Ehlig
- The topic ‘How to show correct number of Facebook comments on frontpage?’ is closed to new replies.