There are often times when we feel a need for adding PHP codes to our WordPress pages or posts. But the thing about WordPress is that it does not let us include any external PHP codes. However, WordPress allows us to run HTML codes and CSS codes. But when it comes to PHP, it does not allow us to do so.
So the question is how to Add PHP Code to WordPress Post or Page? Well if you have this question in your head. Then you better stick with this page. In this article, we will talk about complete steps that you need to follow to add PHP codes to your WordPress posts and pages.
How to Insert PHP Code in a WordPress – Of course, WordPress does not permit running PHP code in posts or pages. Be that as it may, some of you may require this usefulness. This instructional exercise tells you the best way to add PHP to WordPress posts and pages with an assistance of a plugin.
Installing Insert PHP plugin
PHP code can be run in WordPress posts and pages using Insert PHP plugin. Access your WordPress administrator dashboard and follow these steps in order to install this plugin:
- Under Plugins section press Add New button.
- Enter Insert PHP in the search field.
- Hit Install button.
Inserting PHP code in your post
Start another WordPress post or page and put PHP code you need to run. Remember that normal PHP opening and shutting labels () must be substituted with short labels [insert_php] and [/insert_php] individually
That’s It, Now you’re done. You have successfully created a PHP Code to WordPress Website.