Support » Fixing WordPress » PHP in pages, wp1.5

  • i one to run an include(); or some other php code in my pages (wp 1.5) – is there another solution than the “RunPHP” plugin (which is very limited :S).

    thanks in advance,

Viewing 8 replies - 1 through 8 (of 8 total)
  • Moderator Matt Mullenweg



    You can use custom templates, you can even have a different template for every page.

    Samer, I created a small similar plugin to RunPHP, but if that doesnt fit your needs, i dont think mine will either…

    The only “difference” is that mine cache the php code to a file, and then includes these files, as RunPHP evaluates the code each time…

    You can se it in action at my about page that calls both the wp version and the plugins in use via small php code snippets…

    Every page can have it’s own Template if you so choose. You can put whatever PHP in the templates.

    For the record, RunPHP has been working fine for me. I’m using it to keep my sidebar tidy and putting stuff like my blogroll and archive listing on other pages.

    Depends on where you need the PHP. I use RunPHP for some things, custom templates for others. If you can, use a custom template: fewer eval()’s

    thank you for the useful replies.

    I want to use David Chait’s CG-Amazon on two different static pages, one of which I’m working on now (Music).

    Problem: Creating the PHP code that CG Amazon needs to display the listings on several different static pages, NOT in the sidebar content.

    Comment: While I UNDERSTAND and APPRECIATE that one can create a page-specific template, I think this defeats the ease of using pages for purposes such as mine. I also want to avoid having a million jillion trillion templates for this thing and that. It’s one of the features that set WP apart from MT in my mind: The fact that you didn’t necessarily NEED all those templates floating around. All that being said, here’s what I’ve tried, without success:

    1. I just didn’t understand the “WP Executables” plugin and I’m not sure it’s what I need to accomplish the task anyway. So I abandoned the use of it.

    2. I found RunPHP and installed it, disabled the XML thing in my WP console, created the page, edited the page and checked “eval” as instructed. I get this output:

    ‘Parse error: parse error, unexpected ‘\’’ in /home/myblog/public_html/wp-content/plugins/cg-plugins/runphp.php(96) : eval()’d code on line 1’

    I’m sure I need to look to the plugin’s author for help with this, but was hoping perhaps this is a common enough error that there might be an easily-recognized solution – to someone well versed in PHP. I am not such a person.

    I found the solution to my problem to some extent. This at least works with the ChaitGear suite of plugins and possibly, by the sound of it, with other PHP coding as well, from David Chait’s web site:

    My third entry is CG-QuickPHP, a little hack of a plugin for embedding PHP function calls within the body of a Post or Page. Now you don’t have to ask “How do I get a CG-FeedRead feed on a Page?� NOTE: 0.7 was broken such that it wouldn’t actually ‘hook in’. Fixed for 0.8.

    And the download link is here:

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘PHP in pages, wp1.5’ is closed to new replies.