好的,所以我需要使用the_excerpt_rss
过滤并修改代码,使其仅适用于R类别,我刚刚添加了一个is_category("R")
. 您可以在下面找到修改后的全文提要插件:
function ff_restore_text ($content) {
if ( is_feed() & is_category("R")) {
global $post, $page, $pages;
if ( !empty($post->post_password) ) { // if there\'s a password
if ( stripslashes($_COOKIE[\'wp-postpass_\'.COOKIEHASH]) != $post->post_password ) { // and it doesn\'t match the cookie
$content = get_the_password_form();
return $content;
}
}
if ( $page > count($pages) )
$page = count($pages);
$content = preg_replace(\'/<!--more(.*?)?-->/\', \'\', $pages[$page-1]);
}
return $content;
}
add_filter(\'the_excerpt_rss\', \'ff_restore_text\');