Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1442209

    Hello,
    When I share a blog post for example on Facebook the Featured Image I have included in the blog post does not show. Instead, my Logo shows. I investigated this and was told by Facebook’s Debug Tool that –

    Warnings That Should Be Fixed: Inferred Property
    The ‘og:image’ property should be explicitly provided, even if a value can be inferred from other tags.

    I then investigated further and was told by AI to add the following code to the theme’s functions.php file:

    function add_open_graph_tags() {
    if (is_single()) {
    global $post;
    $thumbnail = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), ‘large’);
    if ($thumbnail) {
    echo ‘<meta property=”og:image” content=”‘ . esc_url($thumbnail[0]) . ‘” />’ . “\n”;
    }
    } elseif (is_home() || is_front_page()) {
    // You can set a default og:image for your homepage here
    echo ‘<meta property=”og:image” content=”URL_OF_YOUR_DEFAULT_IMAGE” />’ . “\n”;
    }
    }

    The thing is that I don’t know what the URL_OF_YOUR_DEFAULT_IMAGE is. I tried with a random image url from my WordPress Media folder but the FB Debugger did not like that, either.

    Can you please help? Many thanks and greetings, Lokita

    #1442226

    Hey Lokita,

    Enfold does not have functionality for setting which image should be used when sharing on social networks, you can use a plugin like Yoast SEO or similar for that.

    Best regards,
    Rikard

    #1442341
    This reply has been marked as private.
    #1442375

    Hi,

    Thanks for the update, we’ll close this thread for now then. Please open a new thread if you should have any further questions or problems.

    Best regards,
    Rikard

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Featured Image from Blog Posts not showing when sharing link on Social Media’ is closed to new replies.