我不明白为什么facebook没有在meta标签上看到我的网站内容。我包括fb应用程序ID(但Facebook共享调试器没有看到它)。
header.php中的代码
<html <?php language_attributes(); ?> prefix="og: http://ogp.me/ns#">
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="profile" href="http://gmpg.org/xfn/11">
<?php wp_head(); ?>
<meta property="og:locale" content="lt_LT"/>
<meta property="og:type" content="website"/>
<meta property="og:title" content="TEST"/>
<meta property="og:description" content="Content TEST"/>
<meta property="og:url" content="<?php echo get_site_url();?>"/>
<meta property="og:site_name" content="Website name TEST"/>
<meta property="og:image" content="https://dummyimage.com/600x400/000/fff"/>
<meta property="og:image:width" content="630" />
<meta property="og:image:height" content="1200" />
<meta property="fb:app_id" content="1206909562769520" />
</head>
<body <?php body_class(); ?>>
<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/lt_LT/sdk.js#xfbml=1&version=v2.9&appId=1206909562769520";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
Function.php
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');
我做错了什么?遗失了什么?
Facebook分享调试器显示:
fb:app_id blank
og:url website-URL
og:type website
og:title website url on title.
og:description blank
og:image blank
答案 0 :(得分:0)
https到http重定向问题。解决。