WordPress.org

Ready to get started?Download WordPress

Forums

Facebook Comments
change comment count in my theme (5 posts)

  1. chonazz
    Member
    Posted 2 years ago #

    Hi all,

    I'm trying to get the comment count in my theme replaced by the Facebook comment count. I'm not the wordpress developer I would like to be so I need some help.

    This is the block of code that displays my wordpress comment count:

    <li class="comment-count">
            <?php comments_popup_link(__('<span class="icon"></span> 0', 'framework'), __('<span class="icon"></span> 1', 'framework'), __('<span class="icon"></span> %', 'framework')); ?>
    
        </li>

    The code to retrieve the amount of Facebook comments should be this:
    <fb:comments-count href="<?php echo get_permalink($post->ID); ?>"></fb:comments-count>

    I would like the keep the
    <span class="icon"></span> before the number of comments.

    How can I implement the Facebook code into my theme's code?
    Hope someone can help me out,
    Jonas

    http://wordpress.org/extend/plugins/facebook-comments-plugin/

  2. chonazz
    Member
    Posted 2 years ago #

    I'm one step closer to a solution, on my blog page the comment count show perfectly. But on a single page there is nothing shown.
    The code i'm using right now looks like this:

    <li class="comment-count">
    <span class="icon"></span> <fb:comments-count href="<?php echo get_permalink($post->ID); ?>"></fb:comments-count>

    This is my front page: http://www.dewereldverzamelaar.net here you can see it works.
    This is a single page with comments: http://www.dewereldverzamelaar.net/schrijfsels/de-wereldverzamelaar-2-0/ Here you'll see the comment count isn't showing up.

    Jonas

  3. kenanoff
    Member
    Posted 2 years ago #

    Please, please keep us posted on the progress on this. I'm very interested, I guess others as well

  4. lvsquared
    Member
    Posted 2 years ago #

    I just wanted to post some more information in case someone stumbles across this post (or if you two are still interested).

    The reason that you do not see the post count show up on the main page and the individual post page is because of the way the index and single.php theme files are programmed. The bar is called in two different locations.

    In my instance I had to add the Facebook code in my loop.php file (for my main page to load with all the posts) and single.php (for the specific post), and since I wanted to keep the theme bubble it ended up looking like this:

    <span class="comment">
    <fb:comments-count href="<?php echo get_permalink($post->ID); ?>"></fb:comments-count> Comments
    </span>

    If you want to see an example you can check out http://bifty.com and click on any post.

    Hope that helps someone.

  5. yorkhugo
    Member
    Posted 2 years ago #

    Hmmm.... I'm using a plugin that serves a list of the most commented blog posts on my site, and also states the number of comments the particular post has....

    It seems that it would be easier for me to try to replace the wordpress comment count overall with the facebook comment count, since this is my preferred commenting system, but cannot figure out how to hack this....

    I appreciate any additional comments on this thread sincerely and glad I'm not the only one trying to figure the counting out.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic