Viewing 6 replies - 1 through 6 (of 6 total)
  • Dear Sam,

    Could you please help me?

    I would like to have a default Image as comment image on FB.

    What would be the code and where should i put in?

    Thank you in advance!

    Thread Starter Sam

    (@kavaxtreme)

    In the plugin’s root directory there is a file called seofacebook.php which you’ll need to edit. Insert the following around line 321:

    if (has_post_thumbnail()) {
                  $post_thumbnail = wp_get_attachment_image_src(get_post_thumbnail_id(), 'thumbnail');
                  $imageUrl = $post_thumbnail[0];
                } else {
                	$imageUrl = "https://path.to/default/image.jpg";
                }

    Of course you can eliminate the if statement if you don’t want to use featured images when they are available. The other thing you need to do is output the tag, which you can do by adding this code around line 352:

    "<meta property='og:image' content='{$imageUrl}' />",

    Hi Sam!

    Thanks for the promt reply.

    I had time to try your solution, but unfortunately it didn’t work. I’ve faced with the issue as before and now I can not see even the comment on FB.

    You can find the seofacebook.php file with the added lines suggested by you on the link. Could you please take a look on it what could be wrong?

    https://www.dropbox.com/sh/ve1e4qct2dvpwg6/88r6m39ymp

    Thank you for the help in advance!

    Thread Starter Sam

    (@kavaxtreme)

    I don’t see any problems in the code, but your website doesn’t seem to be using Open Graph tags. You may just need to turn them on in the plugin’s settings. You can use the “debug” link above to see whether FB is seeing them for your pages or not.

    PERFECT!
    Thank you ??

    Hi, could you be more specific about where this code goes in the seofacebook.php file. I can’t see anywhere that tells me the line numbers. Thanks

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘[Plugin: SEO Facebook Comment] Feature Request – og:image Support’ is closed to new replies.