Support » Fixing WordPress » How to run PHP code in static pages?

  • Resolved parham90

    (@parham90)


    Hi,

    I have tried searching for plugins that make it possible to run PHP code in a page. However, they all seem to be out of date, and they mostly are compatible with WordPress 2.8 or 2.9, not WordPress 3.1. I was wondering if there is now a way to run PHP without using these plugins or something alike, or is there another reason for the lack of these plugins being maintained?

    Thanks!

Viewing 6 replies - 1 through 6 (of 6 total)
  • WordPress is entirely PHP, so that’s not out of scope, by any means. All posts/pages are generated by it, so “running PHP” is something of a conundrum. What are you trying to do?

    I am converting an already-created website to WordPress. This is the first time I’m using WordPress, so please excuse the newbie-ish questions. 🙂

    I have previously written a contact form, and I thought just copy-pasting the code in that file into the editor for a page might not work. I have already disabled the visual editor and verified that the automatic-balancing of XHTML elements is not checked.

    Well, as you see in http://wordpress.org/extend/plugins/exec-php/ the plugin is compatible up to version 2.8 of WordPress.

    OK, we need more information. What are you expecting? What are you seeing instead? I’m guessing that your form code is more than a few lines. Can you post your contact form code on Pastebin and supply a link to it here, so we can see where it might be tripping things up?

    Pardon me for not updating you further on this.

    It appears that Exec-PHP is actually compatible with the latest WordPress. Installing and then activating the plugin made the code work.

    Thanks for the answers, I appreciate the help! 🙂

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘How to run PHP code in static pages?’ is closed to new replies.