How to add PHP to wordpress text widget

When you need, you can add to the textwidget php script. In standard version, this not work, ┬ábut after added simple code in your child theme in file: functions.php, your php code will be executed. function uniset_php_execute($html){ if(strpos($html,”<“.”?php”)!==false){ ob_start(); eval(“?”.”>”.$html); $html=ob_get_contents(); ob_end_clean(); } return $html; } add_filter(‘widget_text’,’uniset_php_execute’,99);   After that, In your textwidget add simple … Continue reading How to add PHP to wordpress text widget