在Wordpress上使用插件显示内容来代替后内容

时间:2018-09-01 10:37:05

标签: wordpress

如何不在标题或页脚中显示特定内容(如字符串“ testing”),而在此处用我自己的插件查看帖子的文本。

add_action('wp', 'test');
function test() {
echo " 'test' instead of post text";
};

1 个答案:

答案 0 :(得分:1)

add_filter( 'the_content', function( $content ) {
      return 'Hello World '.$content; }, 0);

您可以以较高的优先级(较低的数字)使用the_content。

相关问题