Comment with Facebook issues

Hello! I recently installed Ultimate Facebook. Set up the app, etc. I have an issue and a question with the commenting with facebook functionality. It's a WP 3.1.3 single-user site with the Invictus theme. Plugin is up to date as of right now.

I would like to use this plugin's functionality to use facebook for all commenting rather than the wordpress comments. I set up the plugin correctly, I think, but I am still seeing a wordpress comment box AND a facebook one on blog posts: http://distinctionjewelry.com/info/designing-jewelry-for-men/

Also, is there any way to apply facebook commenting to pages as well as posts? Most of my site content is in the form of pages, and I would love to be able to allow facebook commenting on them.

Thanks for any help!

Jessi

  • Philip John
    • DEV MAN’s Apprentice

    Hiya Jessi!

    Hmm, I think this could be a theme issue - do you still see both Facebook and the comments box when using the default Twenty Ten theme?

    It doesn't apply to pages yet, but I'll flag the developer for consideration in a future update!

    Cheers,
    Phil

  • shanemcmurray
    • New Recruit

    I'm having similar issues.

    Would it be possible to know which themes the Facebook "comments" part of the FB Plugin actually work with? I've tried a theme I've purchased from someone else and 2 themes here and the FB comments do not work.

    The 2 themes I've tried here are: The Daily and Network. The purchased one is called Inspire.

    Taking Phil's advice above... I change the theme to the default WP theme and the comments work...

    I've double checked install and instructions.. no help.

    What am I missing?

  • Vladislav
    • Dead Eye Dev

    Hi,

    Setting up comments in the right place can be quite tricky, as different themes can treat comments in many different ways. In the latest release (v1.0.6, just released) there is a new Facebook Comments option labeled "Use a custom hook (advanced)", which can help with this problem.

    Depending on the way the comments layout in your theme is set up, you can use some of the standard WordPress/BuddyPress hooks as this field value in order to force the Facebook Comments to render in the right place. In the worst case scenario, you'll have to edit your theme file and add a custom hook there, and enter that as the field value.

    Let me demonstrate this process on the Network theme example. Open up this file in a text editor (I suggest you back up the original file first, just in case):

    <path-to-your-wordpress-directory>/wp-content/themes/network/comments.php

    Then find a line 12 - it should look like this, with some context:

    ...
    ?>
    
    <?php if ( have_comments() ) : ?>
    ...

    Change it to this:

    ...
    ?>
    <?php do_action("my_comments_action"); ?>
    <?php if ( have_comments() ) : ?>
    ...

    Then save your file. As you see, we were just adding a custom hook named "my_comments_action". Since the hook is completely custom, it doesn't do anything by itself yet. We will be binding Facebook Comments to this hook next.

    Next, in your WordPress admin area, go to Facebook plugin settings and open Facebook Comments section. For the last option there, the one labeled "Use a custom hook (advanced)" enter your custom hook: "my_comments_action" (without quotes) and save settings - it should look something like this: http://i56.tinypic.com/2nba61s.png. Your Facebook Comments should now appear just below the post.

  • Mason
    • DEV MAN’s Sidekick

    Hiya,

    As we haven't heard back from ya with any response in awhile I'm gonna mark this one resolved. If you'd like to go through anything further, feel free to re-open this thread. Alternately, you can also always open up a new one.

    Thanks!

  • Vladislav
    • Dead Eye Dev

    Hi,

    It's exactly like Mason said - the Facebook Comments are completely separate from WordPress ones. Therefore, the comment count for your WordPress comments won't change if you have some Facebook Comments too.

    The method described above is used for solving the issues with themes that do not use the hooks the plugin require for inserting (i.e. showing) Facebook Comments form.

  • arthurstjames
    • New Recruit

    here is my code, however I have tried to imput <?php do_action("my_comments_action"); ?> on several lines with no avail. anyone have suggestions as to where to put it, here is my comments file

    <?php // Do not delete these lines
    if (!empty($_SERVER['SCRIPT_FILENAME']) && 'comments.php' == basename($_SERVER['SCRIPT_FILENAME']))
    die ('Please do not load this page directly. Thanks!');
    if (function_exists('post_password_required'))
    {
    if ( post_password_required() )
    {
    echo '<p class="nocomments">This post is password protected. Enter the password to view comments.</p>';
    return;
    }
    } else
    {
    if (!empty($post->post_password))
    { // if there's a password
    if ($_COOKIE['wp-postpass_' . COOKIEHASH] != $post->post_password)
    { // and it doesn't match the cookie ?>
    <p class="nocomments">This post is password protected. Enter the password to view comments.</p>
    <?php return;
    }
    }
    }
    if (function_exists('wp_list_comments')) :
    //WP 2.7 Comment Loop
    if ( have_comments() ) : ?>
    <div class="comment-wrap">
    <?php if ( ! empty($comments_by_type['comment']) ) : ?>

    <h3 id="comments"><?php comments_number('No Comments', 'One Comment', '% Comments' );?></h3>
    <ol class="commentlist">
    <?php wp_list_comments('type=comment'); ?>

    <?php endif; ?>

    <?php if ( ! empty($comments_by_type['pings']) ) : ?>
    <h3 id="pings">Trackbacks/Pingbacks</h3>

  • Vladislav
    • Dead Eye Dev

    Hello,

    Have you tried putting it just before the "if (function_exists('wp_list_comments')) :" line? Since this line is already within PHP code tags you don't need to include the tags (<?php and ?> bits) with that line, so your code would look something like this:

    ...
    do_action("my_comments_action");
    if (function_exists('wp_list_comments')) :
    ...

    You can use any other name instead of "my_comments_action", but also, remember to paste that value into the custom hook box in your plugin settings (without quotes, of course).

  • arthurstjames
    • New Recruit

    Thanks VeBailovity that did the trick. Being a little bit of a newbie I couldn't figure it out.

    Ok, now, when I disable WordPress comments (through my theme) the facebook comments disappears also. Any suggestions??

    I have these checked in the plugin, but my wordpress comments are still there. How can I shut off the default wordpress comments and only show the facebook comments????

    checked> Use Facebook for comments

    checked> Override WordPress discussion settings

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.