2016-01-20 42 views
0

meta標籤我對WordPress的一個網站,我宣佈og meta標籤下面所提到:OG中的WordPress

<meta property="og:locale" content="fa_IR" /> 
<meta property="og:type" content="website" /> 
<meta property="og:title" content="معامله امن بازی های آنلاین - کافه گیم" /> 
<meta property="og:description" content="معامله امن بازیهای آنلاین" /> 
<meta property="og:url" content="http://cofegame.ir/" /> 
<meta property="og:site_name" content="کافه گیم" /> 

,但是當我在電報發送我的網站鏈接http://cofegame.ir, 它顯示了這一點:

enter image description here

我該如何解決這個問題? 我使用WordPress和Yoast SEO插件並停用了所有插件,但問題仍然存在。

謝謝!

+0

我不明白。問題是什麼?你能告訴我們你期望什麼嗎?或者什麼不是你想要的? – Ciseur

回答

2

你錯過

<meta property="og:image" content="your_image_url_here" /> 

元標記。當您分享您的網站網址時,這將會有圖片。

我通常把我的OG meta標籤在標題是這樣的:

<meta property="og:url"   content="<?php the_permalink(); ?>" /> 
<meta property="og:type"   content="website" /> 
<meta property="og:title"   content="<?php echo get_the_title(); ?>" /> 
<meta property="og:description" content="<?php echo get_the_excerpt(); ?>" /> 
<?php if(has_post_thumbnail()): 
    $url = wp_get_attachment_url(get_post_thumbnail_id()); 
?> 
<meta property="og:image"   content="<?php echo $url; ?>" /> 
<?php else: 
    $theme = wp_get_theme(); 
    $screenshot_url = esc_url($theme->get_screenshot()); 
?> 
<meta property="og:image"   content="<?php echo $screenshot_url; ?>" /> 
<?php endif; ?> 

這樣一來,如果您分享文章,你就會有它的標題,摘要,鏈接和縮略圖。如果你沒有設置縮略圖,我把主題截圖。這當然可以自定義,以顯示您的自定義圖像。

希望這會有所幫助。

+0

感謝您的幫助我編輯元標記 我有同樣的問題 – jef

+0

您的圖片鏈接應該是'http://www.cofegame.ir/wp-content/uploads/2016/ 01/C ofegame1.jpg' –

+0

謝謝我的圖片地址有http,但在stackoverflow評論刪除該內容 jef