Why when sharinga site on Facebook sent the picture the other news?

Hello! There is a site on wordpresswhere the header set up meta tags for twitter and facebook set using the open graph. (the problem with rendering pictures and facebooking)
The code itself
<meta name="twitter:site" content="@http://site.ru">
 <meta name="twitter:creator" content="@site.ru">
 <meta name="twitter:card" content="summary_large_image">
 <meta name="twitter:title" content="<?php the_title(); ?>">
 <meta property="og:type" content="image/jpeg">
 <meta property="og:url" content="http://site.ru">
 <meta property="og:title" content="<?php the_title(); ?>">
 <meta name="twitter:description" content="<?php while (have_posts()):the_post();
 $out_excerpt = str_replace(array(" \r\n", "\r", "\n", "'" ,"\""), "", get_the_excerpt()); echo $out_excerpt; endwhile; ?>">
 <meta property="og:description" content="<?php while (have_posts()):the_post();
 $out_excerpt = str_replace(array(" \r\n", "\r", "\n", "'" ,"\""), "", get_the_excerpt()); echo $out_excerpt; endwhile; ?>">
 <?php if(!has_post_thumbnail( $post--->ID ))
{
$default_image='site.ru/logo.png';
 echo '<meta name="twitter:image:src" content="' . $default_image . '">';
 echo '<meta property="og:image" content="' . $default_image . '">';
}
else
{
 $thumbnail_src = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'full' );
 echo '<meta name="twitter:image:src" content="' . esc_attr( $thumbnail_src[0] ) . '">';
 echo '<meta property="og:image" content="' . esc_attr( $thumbnail_src[0] ) . '">';
 } echo "\n"; ?>
 <link rel="profile" href="http://gmpg.org/xfn/11">
 <link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>">

Here in this form appears on the website
<meta name="twitter:site" content="@http://site.ru">
 <meta name="twitter:creator" content="@site.ru">
 <meta name="twitter:card" content="summary_large_image">
 <meta name="twitter:title" content="Content">
 <meta property="og:type" content="image/jpeg">
 <meta property="og:url" content="http://site.ru">
 <meta property="og:title" content="Title">
 <meta name="twitter:description" content="description">
 <meta property="og:description" content="description">
 <meta name="twitter:image:src" content="http://site.ru/img-768x500.jpg"><meta property="og:image" content="http://site.ru/img-768x500.jpg">
 <link rel="profile" href="http://gmpg.org/xfn/11">
 <link rel="pingback" href="http://site.ru/xmlrpc.php">

When sharinga in Twitter all the news are displayed fine, but
the facebook debugger says this error:
The property "og:image" must be specified explicitly, even if its value can be calculated based on other tags.

and displays every time the same picture (not news, buyout post!), and not logo, as one might think, and are taken from other news. (although the code appears correct, and as for Twitter)
In what could be the error and how to fix it?
June 10th 19 at 16:56
1 answer
June 10th 19 at 16:58
Apparently, the mistake was found - replaced the url of the root site to the url of the specific page and have written the type of content depending on the page
<?php if (is_single()) { ?> 
<meta property="og:type" content="article">
<?php } else { ?> 
<meta property="og:type" content="website"> 
<?php } ?> 
<meta property="og:url" content="<?php the_permalink(); ?>">

Find more questions by tags Optimizing the site for social networks