Viewing 17 posts - 1 through 17 (of 17 total)
  • Author
    Posts
  • #1016405

    I couldn’t find a solution to this anywhere but on my front page the feature image doesn’t show up as the og:image so I get “The ‘og:image’ property should be explicitly provided” when using facebook debugger… but when I change the page to not be the front page it works fine when scraped. Site is imappivut.com

    ideas?

    #1016420

    Hey Rob,

    Do you mean that it’s not being included when you share on Fb? Are you using an SEO plugin like Yoast to set the image to be shared?

    Best regards,
    Rikard

    #1016425

    Yes, it’s not showing when I share on facebook. I have Yoast installed and have tried uploading a facebook specific photo through that but it doesn’t work whether I do that or not.

    #1016433

    Hi,

    Ok, thanks for the feedback. Please send us a temporary admin login and login URL so that we can have a closer look. You can post the details in the Private Content section of your reply.

    Best regards,
    Rikard

    #1016444

    Ok, thanks for taking a look!

    #1016446

    Hi,

    Thanks for the login details. Is it the front page you are having problems with? If so then there is no image added to Yoast SEO for that page.

    Best regards,
    Rikard

    #1016449

    I know, but it doesn’t matter if there is an image or not, it doesn’t work. While other pages which do not have an image uploaded to Yoast do work by only having a feature image specified.

    #1016455

    Hi,

    Please try to add this code to the child theme functions.php to fix the issue:

    
    add_filter('wpseo_twitter_image', 'avia_set_yoast_og_image', 10, 1);
    add_filter('wpseo_opengraph_image', 'avia_set_yoast_og_image', 10, 1);
    function avia_set_yoast_og_image($url)
    {	
    	if(empty($url) && has_post_thumbnail())
    	{
    		return get_the_post_thumbnail_url();
    	}
    
    	return $url;
    }
    
    

    Another user reported this as a bug to Yoast (see https://kriesi.at/support/topic/yoast-seo-premium-missing-facebook-preview-image/#post-1007741 ) and hopefully they’ll fix it soon.

    Best regards,
    Peter

    #1016687

    I put that in the child theme and it doesn’t seem to work.

    #1017387

    Hi,

    You can try this code on the functions.php file to set the og:image manually.

    add_action('wp_head', 'ava_add_og_image');
    function ava_add_og_image() {
        if(has_post_thumbnail()) {
            $featured_img_url = get_the_post_thumbnail_url(get_the_ID(),'full'); 
            echo '<meta property="og:image" content="'.esc_url($featured_img_url).'" />';
        }
    }

    I’m not sure why the image meta is not there on the home page.

    Best regards,
    Ismael

    #1017622

    That seems to cause a parse error and not work.

    #1017646

    Hi!

    Where do you see the error? Did you put it in the functions.php file?

    Best regards,
    Ismael

    #1017662

    Yes. I get an error on facebook debugger and the og:image doesn’t show up in the header. I can see in the code that it is not here. Take a look, I will leave the code in the child theme functions.php file.

    #1018166

    Hi,

    The og:image property is rendered on the page’s markup when I check. Odd thing is, I can’t access the facebook debugger. We’ll get back to you once the debugger loads. (see private field)

    Best regards,
    Ismael

    #1018174

    I don’t see og:image rending in the header code for the page. Nor does it seem to work in facebook debugger. Still shows up for subsequent pages.

    #1018175

    Not sure what happened but it now seems to be working.

    #1018764

    Hi,

    Cool. Glad it’s working. Please feel free to open a new thread if you encounter any issues. :)

    Best regards,
    Ismael

Viewing 17 posts - 1 through 17 (of 17 total)
  • The topic ‘og image doesn't show on front page’ is closed to new replies.