我正在使用Addthis
向Wordpress博客添加分享按钮。
除了Pinterest之外,我的自定义图标也能正常工作。
当我使用addthis_button_pinterest_share
类时,我可以使用自定义图标,但当我使用addthis_button_pinterest_pinit
类时,我就不能使用自定义图标了。
在我的循环中,下面的代码会提示正确分享图片,但图标图片会被Pinterest按钮覆盖:
<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>
同时,这会导致提示从页面上的图片库共享(不是我指定的图像),但自定义图标图像工作:
<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
指定要共享的特定图像
发布于 2014-10-10 06:06:40
您可以通过Open Graph协议使用addthis_button_pinterest_share指定要共享的特定图像。尝试添加以下内容:
<meta property="og:image" content="URL to your image" />
这里还有一些关于addthis_button_pinterest_share http://support.addthis.com/customer/portal/articles/1300322-pinterest-image-sharing的参考资料
https://stackoverflow.com/questions/25836520
复制相似问题