Shortcode: [php] – X-Plus
PHP
PHP – [ php]
[ php]php code[/php]
The [ php] shortcode allows you use php within a page, post, or text widget.
Shortcode usage: [ php]php code[/php]
The [ php] and [/php] act like <?php and ?> in an actual .php file. The PHP code is executed using the PHP exec() function and any resulting output added to the HTML page. If your PHP has any errors, or your system has exec() disabled, there will be no output.
For site security reasons, you also must open the Appearance : Xtreme Plus option page, click the PHP tab, and check the For site security reasons, you must check this to enable the
shortcode. </strong>box. Important note: For Posts and Pages, if your php code spans multiple lines (i.e., you use the Enter key), then you must use the HTML editor view, and check the Raw HTML per page option in the page/post editor screen. Short PHP snippets on just one line will work from either the HTML or Visual editors. If you use the shortcode in an advanced HTML insertion area, then your end of lines will work as expected. Example: [ php]echo 'WordPress Version:'l bloginfo('version');
would show something like:
WordPress Version: 4.7.2