网上有几个例子,但我用的是:
<?php
//functions.php
add_filter( \'widget_text\', \'php_parser\', 100 );
function php_parser( $html ){
if( strpos( $html, "<"."?php" ) !== false ){
ob_start();
eval( "?".">".$html );
$html = ob_get_contents();
ob_end_clean();
}
return $html;
}
?>