By default, you can’t execute PHP in WordPress posts and pages. We’ve made it a rule of thumb to by no means execute PHP in our posts and pages both as a result of it may be hectic to vary issues sooner or later. A greater observe could be to edit the WordPress theme by making a customized web page template, or single submit template. Nonetheless for some customers, it might be essential to execute PHP in WordPress posts. We couldn’t discover a want for it, however apparently over 26,000 individuals have. So on this article, we’ll share the way to enable PHP in WordPress posts and pages.
Merely set up and activate the plugin Enable PHP in Posts and Pages. After set up, merely wrap your php queries contained in the shortcode:
[ php] [ /php] – Please ignore the areas. We can not use this shortcode as a result of it’s going to pull our Syntax Highlighter Developed plugin.
It’s also possible to save your php queries and name them on submit or pages once you want them. To do that, merely click on on Enable PHP in Posts menu possibility. Click on on the Code Snippets Tab. Add your PHP question there.
Then in your submit, merely use the shortcode with the Snippet ID: