Facebook Open Graph Not Working With Yoast SEO

Posted in: Newspaper
Post count: 8

Hello. I have installed Yoast SEO for Facebook OG but facebook still loads the features images instead of OG image.

Post count: 35449

Hi,

In order to work the custom image from Yoast SEO you need to comment/remove some code in theme files, wp-content/themes/Newspaper/includes/wp_booster/td_wp_booster_functions.php
-> https://www.screencast.com/t/gR50UqkZ4z

Thank you!

Post count: 8

if (is_single()) {
global $post;

// facebook sharing fix for videos, we add the custom meta data
if (has_post_thumbnail($post->ID)) {
$td_image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'full' );
if (!empty($td_image[0])) {
echo '<meta property="og:image" content="' . $td_image[0] . '" />';
}
}

this is the code

  • This reply was modified 7 years by deep16.
  • This reply was modified 7 years by deep16.
  • This reply was modified 7 years by deep16.
Post count: 35449

Hi,

Just make sure that you comment the lines like this -> https://www.screencast.com/t/OMyytajh

Thank you!

Post count: 21

Hi @Calin,

I assumed that after update this issue should be fixed. Now I can’t see this part of code in file: https://www.screencast.com/t/OMyytajh

However I still see that meta date is doubled: https://imgur.com/a/iOO4His

Post count: 35449

Hi,

Yes, this issue is note on the fix list for the coming update.

Thank you!

Viewing 6 posts - 1 through 6 (of 6 total)
The forum ‘Newspaper’ is closed to new topics and replies.