在LinkedIn上分享Wordpress博客文章

时间:2015-06-30 10:37:09

标签: php wordpress linkedin

我有这段代码,将我的博客文章分享到LinkedIn:

<a href="https://www.linkedin.com/shareArticle?mini=true&url=<?php echo urlencode(get_permalink());?>&source=testing" onClick="return popup(this, 'posts')" data-url="<?php echo the_permalink($post->ID); ?>"class="button share-social share-linkedin" title="Share on LinkedIn"></a>

它在共享弹出窗口中正确显示我的博客标题,但未显示“来源”,我无法在Linkedin共享弹出窗口中显示博客帖子图片?

这是在PHP中提供PHP代码的正确方法吗?

有没有人有更好的主意?

1 个答案:

答案 0 :(得分:1)

Click to share
$url中存储您需要分享的网址,然后

<?php
$url=the_permalink();
?>
<a href="https://www.linkedin.com/cws/share?url=".<?php echo $url; ?>.">Click to share</a>