如何在页眉或页脚中显示字符串“测试”等特定内容,但是应该使用我自己的插件显示帖子的文本。
add_action('wp', 'test');
function test() {
echo " 'test' instead of post text";
};
add_filter( 'the_content', function( $content ) {
return 'Hello World '.$content; }, 0);
您可以使用具有高优先级(较低编号)的the_content。