How to run PHP in WordPress Posts?
I bet many bloggers would love to run PHP from inside the posts. Running PHP from inside the post would enable us to do a lot of things, for example, add random advertisments.
Till now I have come to know of supposedly three plugins which will allow you to use PHP from inside your posts, pages and widgets. The three are RunPHP, PHPExec and Exec-PHP. From among this only Exec-PHP is WordPress 2.9.1 compatible.
Features of Exec-PHP are as follows:
* Executes PHP code in the excerpt and the content portion of your posts and pages
* Configurable execution of PHP code in text widgets (for WordPress 2.2 or higher)
* Write PHP code in familiar syntax, eg.
* Works in your newsfeeds
* Information about which users are allowed to execute PHP with the current security settings (for WordPress 2.1 or higher)
* Configurable user warnings for inappropriate blog and user settings (for WordPress 2.1 or higher)
* Restrict execution of PHP code in posts and pages to certain users by using roles and capabilities
* Update notifications through the ‘Plugins’ menu in WordPress if a new version of the Exec-PHP plugin is available (for WordPress 2.3 or higher)
* Internationalization support (english and german included, many more available)
* Comes with documentation
How to Install the plugin:
Well it is very easy either go to your plugin section and search for Exec-PHP else download Exec-PHP from here. AFter it is installed activate it.
Configuration
The plugin comes with its own configuration menu that is accessible through ‘Settings > Exec-PHP’. The configuration menu is only accessible for users that do have the ‘edit_plugins’ capability. This is usually only assigned to the Blog Administrator. If you have disabled Javascript or you are running Exec-PHP with WordPress 2.0.x you will not see or only see parts of the plugin configuration menu.
The configuration menu is divided into two parts, the Settings section and the Information section. In the Settings section you can adjust the plugin’s behavior to your needs while the Information section shows which users are allowed to execute PHP code.
Misconfiguration
If the blog or user settings are not appropriate to write PHP code, you will get a warning on the ‘Write’ dialog or ‘Widgets’ menu respectivly.
The WYSIWYG Convesion Warning can be turned off through the ‘Users > Your Profile’ menu. Nevertheless, this is not the recommended way, because this can cause you to accidently render PHP code in articles permanently unuseful.
If you have disabled Javascript or you are running Exec-PHP with WordPress 2.1.0 you will not receive any warnings even if your blog or user settings are not configured appropriately to run Exec-PHP.
For support and further information about the Exec-PHP plugin see the plugins homepage at http://bluesome.net/post/2005/08/18/50/.
Category: Internet Tips








Love your comment form. It integrates so seamlessly with your current theme
.-= TechChunks´s last blog ..The Buzz About ‘Google Buzz’: It’s too Late, Dull and Probably Going to Flop =-.
Great …..
PHP in wordpress post…….
Looking forward to read it………..
Digital Imagination recently posted..The Week in Technology
hey this comment form is really awesome… have used any execPhp here?
Chethan recently posted..New iPhone app, Pepsi Loot. Get freebies for an entry in restaurants!
can i used it with wordpress 3.01?
Rohit recently posted..Online create Favicon for your Blog Website easily
im using Exec-php plugin with evening shade theme but it is not displaying php code and text is displayed on page with php tags like
can you help me to solve my problem
Hey that is really a nice way to have and really liked the way you presented the post, very easy to follow.
Keep writing good posts like this
Robert recently posted..Intro
I’m having the same problem as sharal – the < and ? in the php tags keep separating like < ?php – and the php isn't executed..