index.php ye değild e postları paylaştığınız kısımdan header a referans vermelisiniiz hocam. nasıl ki post sayfasının kendi meta etiketleri varsa, aynı mantıkla facebook referanslarını da bu meta etiketlerine benzer şekilde doldurmalısınız
| Facebook paylaşımında yazıya eklenen fotoğrafın görünmemesi | 19 Mesajlar | 2.466 Okunma | ||
//Adding the Open Graph in the Language Attributes
function add_opengraph_doctype( $output ) {
        return $output . ' xmlns:og="http://opengraphprotocol.org/schema/" xmlns:fb="http://www.facebook.com/2008/fbml"';
    }
add_filter('language_attributes', 'add_opengraph_doctype');
 
//Lets add Open Graph Meta Info
 
function insert_fb_in_head() {
    global $post;
    if ( !is_singular()) //if it is not a post or a page
        return;
        echo '';
        echo '';
        echo '';
        echo '';
    if(!has_post_thumbnail( $post->ID )) { //the post does not have featured image, use a default image
        $default_image="http://example.com/image.jpg"; //Buradaki resim eğer postun öne çıkan görseli yoksa görüntülenecek resim adresidir
        echo '';
    }
    else{
        $thumbnail_src = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'medium' );
        echo '';
    }
    echo "
";
}
add_action( 'wp_head', 'insert_fb_in_head', 5 );
        echo '';
        echo '';
        echo '';
        echo '';
    if(!has_post_thumbnail( $post->ID )) { //the post does not have featured image, use a default image
        $default_image="http://example.com/image.jpg"; //Buradaki resim eğer postun öne çıkan görseli yoksa görüntülenecek resim adresidir
        echo '';
    }
    else{
        $thumbnail_src = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'medium' );
        echo '';
    }
    echo "
";
AhmetKarabulut adlı üyeden alıntı
        echo '';
        echo '';
        echo '';
        echo '';
    if(!has_post_thumbnail( $post->ID )) { //the post does not have featured image, use a default image
        $default_image="http://example.com/image.jpg"; //Buradaki resim eğer postun öne çıkan görseli yoksa görüntülenecek resim adresidir
        echo '';
    }
    else{
        $thumbnail_src = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'medium' );
        echo '';
    }
    echo "
";
AhmetKarabulut adlı üyeden alıntı
otuzgun
//Adding the Open Graph in the Language Attributes
function add_opengraph_doctype( $output ) {
        return $output . ' xmlns:og="http://opengraphprotocol.org/schema/" xmlns:fb="http://www.facebook.com/2008/fbml"';
    }
add_filter('language_attributes', 'add_opengraph_doctype');
 
//Lets add Open Graph Meta Info
 
function insert_fb_in_head() {
    global $post;
    if ( !is_singular()) //if it is not a post or a page
        return;
        echo '';
        echo '';
        echo '';
        echo '';
    if(!has_post_thumbnail( $post->ID )) { //the post does not have featured image, use a default image
        $default_image="http://example.com/image.jpg"; //Buradaki resim eğer postun öne çıkan görseli yoksa görüntülenecek resim adresidir
        echo '';
    }
    else{
        $thumbnail_src = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'medium' );
        echo '';
    }
    echo "
";
}
add_action( 'wp_head', 'insert_fb_in_head', 5 );
        echo '';
        echo '';
        echo '';
        echo '';
    if(!has_post_thumbnail( $post->ID )) { //the post does not have featured image, use a default image
        $default_image="http://example.com/image.jpg"; //Buradaki resim eğer postun öne çıkan görseli yoksa görüntülenecek resim adresidir
        echo '';
    }
    else{
        $thumbnail_src = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'medium' );
        echo '';
    }
    echo "
";