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

问题描述 投票:0回答:1

如何在页眉或页脚中显示字符串“测试”等特定内容,但是应该使用我自己的插件显示帖子的文本。

add_action('wp', 'test');
function test() {
echo " 'test' instead of post text";
};
wordpress
1个回答
1
投票
add_filter( 'the_content', function( $content ) {
      return 'Hello World '.$content; }, 0);

您可以使用具有高优先级(较低编号)的the_content。

© www.soinside.com 2019 - 2024. All rights reserved.