【发布时间】:2012-06-22 23:28:04
【问题描述】:
我有一些 Pinterest 代码可以在我的 wordpress 帖子上显示一个 Pin it 按钮,但它只抓取帖子缩略图。我想要的是抓取第一个帖子内容图片,如果帖子中没有图片,则只抓取缩略图!??
尝试了很多例子,但没有任何效果。
<a href="http://pinterest.com/pin/create/button/?url=<?php the_permalink(); ?>&media=<?php $thumb = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'thumbnail' ); echo $thumb['0']; ?>&description=<?php the_title(); ?>" class="pin-it-button" count-layout="horizontal">Pin It</a>
【问题讨论】: