我试图在functions.php中使用这个函数来获取帖子的缩略图并将它们添加到我的RSS提要中。
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');
问题是——这使我的服务器崩溃。我收到 500 错误。如果我注释掉这些add-filter
行,则没有错误。
有人帮忙看看这里发生了什么吗?我正在使用 Wordpress 3.1.2,论文主题。
谢谢!