我已将开放图元数据添加到functions.php:
function insert_fb_in_head() {
global $post;
if ( !is_singular())
return;
echo \'<meta property="fb:admins" content="PAGE_ID"/>\';
echo \'<meta property="og:title" content="\' . get_the_title() . \'"/>\';
echo \'<meta property="og:type" content="article"/>\';
echo \'<meta property="og:url" content="\' . get_permalink() . \'"/>\';
echo \'<meta property="og:site_name" content="SITE_TITLE"/>\';
echo \'<meta property="og:image" content="\' . $default_image . \'"/>\';
}
add_action( \'wp_head\', \'insert_fb_in_head\', 5 );
但是,从HTTPS粘贴时,它不会获取OG数据。从HTTP共享工作得非常好。我还尝试添加:
og:image:secure_url
也没用。