【发布时间】:2012-02-25 18:26:56
【问题描述】:
我正在使用我的 WordPress RSS 源在 MailChimp 中设置一个 RSS 到电子邮件活动,并且我想在我的 MailChimp 模板中包含特色图片。 我尝试使用它来添加图像,它有效,但它只是将它添加到内容中,这对于 RSS 代码的 MailChimp 部分不起作用:
function featuredtoRSS($content) {
global $post;
if ( has_post_thumbnail( $post->ID ) ){
$content = '' . get_the_post_thumbnail( $post->ID, 'thumbnail', array( 'style' => 'float:left; margin:0 15px 15px 0;' ) ) . '' . $content;
}
return $content;
}
add_filter('the_excerpt_rss', 'featuredtoRSS');
add_filter('the_content_feed', 'featuredtoRSS');
显然,MailChimp 希望它是“自己的”独特的图像元素。以下是他们想要的示例:http://kb.mailchimp.com/article/how-can-i-format-the-image-content-in-my-rss-to-email-campaigns
但它看起来像是不同的 RSS 格式。这是我的 RSS 输出的内容:http://pacmissions.org/dev/missions/zimbabwe-2012/feed/
【问题讨论】:
标签: image wordpress rss mailchimp