RunPHP – Include PHP in your wordpress blog posts or pages

By | April 22, 2007

RunPHP by James van Lommel, is a Plugin for WordPress that enables bloggers to embed PHP code directly into their posts.

How to use:

  • Download the plugin from the author’s site, and upload the files to the plugin directory of your wordpress weblog (/wp-content/plugins).
  • Activate the plugin by logging into your WordPress administration panel, going to ‘Plugins’ on the menu bar, then clicking Activate at the end of the RunPHP row.
  • Now add php codes in your posts and pages, by simply checking the new option box that says ‘run PHP code?’

The code executed by runPHP is not in the global scope. It is executed as if it were inside a function block and so you’ll need to declare your globals accordingly.

Note: The plugin doesn’t work with few badly written WordPress themes. This is most likely caused by a missing wp_head() call in the theme’s header template (often called header.php). If that is the case, fixing it is simply a matter of inserting.

5 thoughts on “RunPHP – Include PHP in your wordpress blog posts or pages

  1. Pete

    HI,

    Did you ever test rss2html with this plugin, and did you have any luck?

  2. Blogger Tools Post author

    Hi,

    I have indeed experimented with rss2html
    You can use the script in your posts or pages by assigning the variables and including the file, like this

    < ?php
    $MAXITEMS = '5';
    $TEMPLATE = 'example.html';
    $XMLFILE = 'http://your.rss';
    include('full/path/to/rss2html.php');
    ?>

  3. Iván

    Thank you 4 the plugin.
    For me it works perfectly.

  4. Roch

    What I am looking to do is similar. I am looking to have a static page as well as the blog appear on the main page of my wordpress site. Right now going to the settings section will only allow me to do one or the other. any feedback would be appreciated.

Comments are closed.