Support » Plugin: Facebook » Version 1.1.5 custom positioning of comments box does not work

  • On 1.0.2 I used to include the comments box where I wanted in the template with:

    if (comments_open() && isset($fb_ver) && ($fb_options = get_option('fb_options')) && isset($fb_options['comments']['enabled']))
                     echo fb_comments_automatic(''); ?>

    Now this does not work any more, and it only works if I explicitly choose the post or page checkbox, which displays it in the incorrect place.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Niall Kennedy


    $fb_ver is gone. $facebook_loader exists as a global after the init action and may be used as an indicator the plugin has loaded. The comments box is considered “enabled” if it is selected for one or more post types. You may also interact with the facebook_comments_enabled option.

    The default behavior of comments box inclusion is as a filter to the_content, insertion of a div with HTML5 data-* attributes to be interpreted by the Facebook JavaScript SDK on initialization, and a noscript fallback. If you are writing custom code make sure the Facebook JavaScript SDK is still loaded so it may interpret the comments box element and your preferences.

    See Facebook_Comments::the_content_comments_box() and the Facebook_Comments class in general.

    So whats the correct version of the code to include in a template if we want it to be where we want it rather than when Facebook thought it should be?!

    Please just include the replacement code rather than a lot of gibberish explanations. Its already bad enough that the latest changes are not backward compatible and not included in the release notes (apart from the hickups of the 1.1 updates!)

    Plugin Author Niall Kennedy


    Yeah, but being Facebook, you could have at least documented that the change is not backward compatible any more with users who are using it in a certain way (which is how Facebook suggests btw)! Its the least you could have put in the release notes.

    Can you at least confirm that this is the way to go if I have to put the comments box where I want (rather than exactly at the end of the article content)?

    $options = get_option( 'facebook_comments' );
     if (is_array( $options ) && !empty($options))
         $url = apply_filters( 'facebook_rel_canonical', get_permalink() );
         if ($url)
            $options['href'] = $url;
         echo Facebook_Comments::js_sdk_markup( $options );
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Version 1.1.5 custom positioning of comments box does not work’ is closed to new replies.