【发布时间】:2014-11-21 01:43:08
【问题描述】:
我正在尝试让 FB、Twitter 和 Google+ 为我的网站生成正确的数据。到目前为止,当我点击 FB 分享按钮时,我收到一条消息,上面写着“http://invalid.invalid/”。我以为我按照说明进行了操作,但也许我遗漏了一些东西。有人可以帮帮我吗?
头
<html <?php language_attributes(); ?> xmlns="http://www.w3.org/1999/xhtml" xmlns:og="http://ogp.me/ns#" xmlns:fb="https://www.facebook.com/2008/fbml">
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Open Graph data -->
<meta property="og:image" content="<?php bloginfo( 'template_url' ); ?>/img/share.jpg"/>
<meta property="og:url" content="<?php bloginfo( 'url' ); ?>"/>
<meta property="og:title" content="Site Title"/>
<meta property="og:description" content="Site Description"/>
<!-- Twitter Card data -->
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="Site Title">
<meta name="twitter:description" content="Site Description">
<meta name="twitter:image:src" content="<?php bloginfo( 'template_url' ); ?>/img/share.jpg">
<title><?php wp_title( '|', true, 'right' ); ?></title>
<link rel="shortcut icon" href="/favicon.ico" />
<link rel="profile" href="http://gmpg.org/xfn/11">
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>">
<link href="//fonts.googleapis.com/css?family=Montserrat:400,700" rel="stylesheet">
<link href="http://fonts.googleapis.com/css?family=Just+Another+Hand" rel="stylesheet">
<?php mp3j_addscripts(); ?>
<?php wp_head(); ?>
</head>
HTML
<div id="sharing">
<a target="_blank" class="fb_share" href="http://www.facebook.com/share.php?u=<?php bloginfo( 'url' ); ?> /&title=<?php the_title(); ?>" title="Share on Facebook"></a>
<a target="_blank" class="twitter_share" href="http://twitter.com/home?status=<?php the_title(); ?>+<?php bloginfo( 'url' ); ?>" title="Share on Twitter"></a>
<a target="_blank" class="gplus_share" href="https://plus.google.com/share?url=<?php bloginfo( 'url' ); ?>" title="Share on Google Plus"></a>
</div>
【问题讨论】:
-
你有我们的测试链接吗?
-
@luschn 是的,刚刚在上面的帖子中包含了一个。分享链接位于右上角。
标签: wordpress twitter facebook-opengraph