首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
社区首页 >问答首页 >使用Addthis,我如何使用自定义图标并在Pinterest上分享特定的图像?

使用Addthis,我如何使用自定义图标并在Pinterest上分享特定的图像?
EN

Stack Overflow用户
提问于 2014-09-14 18:20:51
回答 1查看 1.8K关注 0票数 2

我正在使用Addthis向Wordpress博客添加分享按钮。

除了Pinterest之外,我的自定义图标也能正常工作。

当我使用addthis_button_pinterest_share类时,我可以使用自定义图标,但当我使用addthis_button_pinterest_pinit类时,我就不能使用自定义图标了。

在我的循环中,下面的代码会提示正确分享图片,但图标图片会被Pinterest按钮覆盖:

代码语言:javascript
运行
AI代码解释
复制
<a class="addthis_button_pinterest_pinit" pi:pinit:url="<?php the_permalink(); ?>" pi:pinit:media="<?= wp_get_attachment_url(get_post_thumbnail_id($post->ID)); ?>" pi:pinit:description="<?= get_the_excerpt();?>">
    <img src="<?php bloginfo('template_url'); ?>/img/icons/social/pinterest.png" />
</a>

同时,这会导致提示从页面上的图片库共享(不是我指定的图像),但自定义图标图像工作:

代码语言:javascript
运行
AI代码解释
复制
<a class="addthis_button_pinterest_share" pi:pinit:url="<?php the_permalink(); ?>" pi:pinit:media="<?= wp_get_attachment_url(get_post_thumbnail_id($post->ID)); ?>" pi:pinit:description="<?= get_the_excerpt();?>">
    <img src="<?php bloginfo('template_url'); ?>/img/icons/social/pinterest.png" />
</a>

有没有办法在addthis_button_pinterest_pinit中使用自定义图标,或者通过addthis_button_pinterest_share指定要共享的特定图像

EN

回答 1

Stack Overflow用户

发布于 2014-10-10 06:06:40

您可以通过Open Graph协议使用addthis_button_pinterest_share指定要共享的特定图像。尝试添加以下内容:

代码语言:javascript
运行
AI代码解释
复制
<meta property="og:image" content="URL to your image" />

这里还有一些关于addthis_button_pinterest_share http://support.addthis.com/customer/portal/articles/1300322-pinterest-image-sharing的参考资料

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/25836520

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档
查看详情【社区公告】 技术创作特训营有奖征文