Support » Plugin: Featured Image by URL » Problem with image on Facebook

  • j019

    (@j019)


    Hi.

    When I want to share a post on Facebook, the image is not shown.

    I tried using the Facebook Debugger tool and it gave me the following errors:
    – Property inferred
    The “og: image” property must be explicitly provided, even if its value can be deduced from other tags.

    – Properties missing
    The following mandatory properties are missing: og: image, fb: app_id

    In all my posts I use the plugin for the featured image.

    Regards.

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Dharmesh Patel

    (@dharm1025)

    Hello @j019 ,

    Yes, currenty. plugin doesn’t supports open graph image property.

    Which SEO plugin you are using? If you are using Yoast SEO then you can try below code in your functions.php

    
    add_filter('wpseo_opengraph_image', 'custom_wpseo_opengraph_image');
    function custom_wpseo_opengraph_image( $image ) {
        if ( is_single() ) {
            $post_id = get_the_ID();
            $image_attributes = get_the_post_thumbnail_url( $post_id );
    	if ( $image_attributes !== false ) {
                $image = $image_attributes[0];
            }
        }
        return $image;
    }
    

    NOTE: This code I directly wrote here and its not tested. please try in local before use it on production

    Best Regards,
    Dharmesh

    j019

    (@j019)

    Hi.
    Thank you very much for your help.
    At this moment I will directly put the featured image in WordPress.

    In the future I will test your code, I will still publish this post in case someone has the same problem can see the code.

    Thank you very much and greetings!

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.