【问题标题】:Multiple images in media for Pinterest buttonPinterest 按钮的媒体中的多个图像
【发布时间】:2013-12-03 22:21:21
【问题描述】:

是否可以在自定义 Pinterest 按钮的媒体参数中包含多个图像?

例如,我知道应该包含一张特定的图片:

<?php $pinterestimage = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'full' ); ?>
<a href="http://pinterest.com/pin/create/button/?url=<?php echo urlencode(get_permalink($post->ID)); ?>&media=<?php echo $pinterestimage[0]; ?>&description=<?php the_title(); ?>" class="pin-it-button" count-layout="vertical">Pin It</a>

但假设我有一个自定义帖子类型的图片轮播。我希望能够将每个图像固定在轮播中。我已经查询了轮播的图像,所以这只是将它们正确编码到 url 中的语法问题。这不起作用:

<a href="http://pinterest.com/../../?url=<?php echo urlenco../&
media=<?php echo $largeImages; ?>&../../>Pin It</a>

其中 $largeImages 是对帖子中所有附件的查询。

【问题讨论】:

    标签: wordpress button pinterest


    【解决方案1】:

    想通了。这很简单,但在文档中没有明确说明。只需完全删除媒体标签,它就会从帖子中提取图片。

    <a href="http://pinterest.com/pin/create/button/?url=<?php echo urlencode(get_permalink($post->ID)); ?>&description=<?php the_title(); ?>" class="pin-it-button" count-layout="vertical"><span><img width="29" height="29" src="<?php bloginfo('template_url'); ?>/img/socialButtons/share/icons/24/pinterest.png" alt="Twitter" /></span></a>
    

    【讨论】:

    • 如何在参数中添加多个媒体图片?
    • 但它没有从该 URL 获取准确的图像。他们还建议额外的图像。我认为如果我们可以在媒体中传递多个图像会更好。我试过了,但是没用。
    猜你喜欢
    • 2023-03-12
    • 2015-05-08
    • 1970-01-01
    • 2016-01-02
    • 1970-01-01
    • 1970-01-01
    • 2014-02-03
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多