Facebook comments not working

I cannot get facebook comments to work on my site.

This code used to work before I used this plugin.

function fb_comments() {
if (!is_page()) { ?>
<div class="fb_comments">
<div id="fb-root"></div><script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script> <fb:comments href="<?php the_permalink();?>" numposts="10" width="630" publish_feed="true"></fb:comments>
</div>
<?php }
}

remove_action('thesis_hook_after_post', 'thesis_comments_link');
add_action('thesis_hook_after_post', 'fb_comments');

I would think I could replace this with something like this

remove_action('thesis_hook_after_post', 'thesis_comments_link');
add_action('thesis_hook_after_post', 'my_action_name');

And name it as my_action_name in the plugin. Why doesn't it work?

I'm using Thesis 1.8.5

  • Tom Eagles
    • Syntax Hero

    @crossfitThames

    Hi there what exactly is happening, as in no comments from facebook reaching your site or something else. I know we have had some minor issues with thesis in the past but this is the first time i have seen this, so i am also going to tag our developer for input at the same time.

    Kindest Regards

    Tom

  • Vladislav
    • Dead Eye Dev

    Hello,

    The reason why this is happening is that, going by the posted snippet, the "add_action" portion is trying to execute a function named "my_action_name" (which most likely doesn't exist), rather than triggering the "my_action_name" hook, which is what the plugin expects.

    Having said that, the solution could be as easy as just entering "thesis_hook_after_post" (without quotes) in your plugin settings, in "Use a custom hook (advanced)" field. You can then remove the custom code, although you'll probably want to keep around this line:

    remove_action('thesis_hook_after_post', 'thesis_comments_link');

  • PC
    • WPMU DEV Initiate

    Hiya,

    Greetings and thanks for being a great community member.

    We haven't heard from you on this one for long and I am doing a regular followup to see if there is still something we can assist you on this thread.

    Just to manage the support issues more efficiently, I am marking this thread as resolved for now however this is not being done to avoid your questions in any ways.

    Please feel free to mark this is "Not resolved" in case you have further questions and we would be back on it.

    Thanks a lot for being with WPMU DEV.

    Cheers
    PC

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.