我在functions.php中为“ the_content”添加了一个过滤器
add_filter ('the_content', 'testFilter');
function testFilter($content) {
if(is_single()) {
$content.="Append content";
}
return $content;
}
现在在我的content-post.php中。我有以下几行:
the_content(__('Test;', 'tag') );
如何将testFilter排除在content-post.php页面上?
在remove_filter
函数上方添加函数the_content(__('Test;','tag'))
。
remove_filter( 'the_content', 'testFilter',11 );
the_content(__('Test;', 'tag') );
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句