标签: 小工具中运行PHP代码

在WordPress文本小工具中运行PHP代码

WordPress文本小工具中可以添加任意HTML代码,但默认PHP代码添加到文本小工具中却不能运行,下面的这段代码很有用! 将以下代码添加到您当前主题的 functions.php 文件: add_filter(‘widget_text’, ‘php_text’, 99); function php_text($text) { if (strpos($text, ‘<‘ . ‘?’) !=
阅读更多 »