fbpx

Add this on your functions.php

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;
}

sample code:

<?php 
//* print the title of the page 
the_title(); ?>