Although WordPress presents you with a powerful platform to run your business websites or blog but sadly enough by default you can’t insert PHP code in your WordPress post or page. But you may want to run PHP functions inside WordPress page or post.
So what’s the way out? Now you don’t need to worry any more as with the use of “Allow PHP in Posts and Pages” WordPress Plugin you can add the PHP code to the HTML post editor and run the PHP codes which were earlier blocked due to non recognition of PHP programming code.
By adding a shortcode [php] your code [/php] “Allow PHP in Posts and Pages” Plugin includes PHP in the WordPress post and pages. With the use of this plugin, WordPress tags automatically disables <p> and <br/> and you are allowed to add your own tags with the BBcode items such as [p] [/p] and [br/]. It also allows you to save frequently used bits of code in the form of snippets to be used across various pages.
It is simple to install and use Allow PHP in Posts and Pages Plugin. Just log-in to your WordPress admin panel. Then in the main menu click “Plugins” and next click “Add New”. Type in the search box “Allow PHP in Posts and Pages” and click on “Search Plugins” button. Once the search is over, find the plugin in the results area and click the install link featured below its title. When prompted click on the “Activate Plugin”.
Further click on the “Posts” and “Add New”. In the editing screen click the “HTML” tag and type the function code. Then click “Update” or “Publish”. Finally you can check your work by clicking on “View Post”. The function then executes from the post itself.
So if you find it necessary to run PHP in WordPress pages and posts then simply install and use the powerful Plugin “Allow PHP in Posts and Pages”.