-
AuthorPosts
-
October 1, 2018 at 5:10 am #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?
October 1, 2018 at 6:15 am #1016420Hey 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,
RikardOctober 1, 2018 at 6:30 am #1016425Yes, 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.
October 1, 2018 at 7:00 am #1016433Hi,
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,
RikardOctober 1, 2018 at 7:27 am #1016444Ok, thanks for taking a look!
October 1, 2018 at 7:33 am #1016446Hi,
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,
RikardOctober 1, 2018 at 7:52 am #1016449I 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.
October 1, 2018 at 8:09 am #1016455Hi,
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,
PeterOctober 1, 2018 at 5:23 pm #1016687I put that in the child theme and it doesn’t seem to work.
October 3, 2018 at 8:09 am #1017387Hi,
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,
IsmaelOctober 3, 2018 at 10:34 pm #1017622That seems to cause a parse error and not work.
October 4, 2018 at 3:20 am #1017646Hi!
Where do you see the error? Did you put it in the functions.php file?
Best regards,
IsmaelOctober 4, 2018 at 4:26 am #1017662Yes. 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.
October 5, 2018 at 7:32 am #1018166Hi,
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,
IsmaelOctober 5, 2018 at 7:55 am #1018174I 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.
October 5, 2018 at 7:59 am #1018175Not sure what happened but it now seems to be working.
October 8, 2018 at 2:58 am #1018764 -
AuthorPosts
- The topic ‘og image doesn't show on front page’ is closed to new replies.