Events will not share correct thumbnail to Facebook

Home Forums Calendar Products Events Calendar PRO Events will not share correct thumbnail to Facebook

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #1085090
    anywherefest
    Participant

    I have searched the forum- no luck so posting here.

    I have finally found a fix to at least set a default image to post to Facebook but I still cannot find a fix to get tribe events to show featured image when shared to Facebook. It’s driving me and my artists bonkers!!

    I am using the code below in functions.php to try to force Facebook to use featured image but it’s not working. Can anyone please help?

    function insert_image_src_rel_in_head() {
    global $post;
    if ( !is_singular()) //if it is not a post or a page
    return;
    if(!has_post_thumbnail( $post->ID )) { //the post does not have featured image, use a default image
    $default_image=”http://anywherefest.com/wp-content/uploads/2016/03/gremlins.jpg”; //replace this with a default image on your server or an image in your media library
    echo ‘<meta property=”og:image” content=”‘ . $default_image . ‘”/>’;
    }
    else{
    $thumbnail_src = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), ‘medium’ );
    echo ‘<meta property=”og:image” content=”‘ . esc_attr( $thumbnail_src[0] ) . ‘”/>’;
    }
    echo ”
    “;
    }
    add_action( ‘wp_head’, ‘insert_image_src_rel_in_head’, 5 );

    #1086037
    Hunter
    Moderator

    Hi and thanks for posting,

    It sounds like you’re experiencing a theme conflict which extend beyond the scope of support we’re able to provide. One idea I have would be to use an open graph plugin. If you’re using Yoast’s WordPress SEO, it has built-in open graph settings too.

    I wish I was able to provide more support and best of luck getting the images to display properly!

    #1092423
    Support Droid
    Keymaster

    This topic has not been active for quite some time and will now be closed.

    If you still need assistance please simply open a new topic (linking to this one if necessary)
    and one of the team will be only too happy to help.

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘Events will not share correct thumbnail to Facebook’ is closed to new replies.