PHP in WordPress Text Widget

Allow PHP in WordPress Text Widget. No plugin, functions file solution. Add the following code to functions.php in child theme folder: [code]add_filter(‘widget_text’, ‘php_text’, 99); function php_text($text) { if (strpos($text, ‘<‘ . ‘?’) !== false) { ob_start(); eval(‘?’ . ‘>’ . $text); $text = ob_get_contents(); ob_end_clean(); } return $text; }[/code] Source: PHP Text Widget — Allow …

PHP in WordPress Text Widget Read More »