WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] How to run PHP code in static pages? (7 posts)

  1. parham90
    Member
    Posted 3 years ago #

    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!

  2. spherical
    Member
    Posted 3 years ago #

    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?

  3. parham90
    Member
    Posted 3 years ago #

    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.

  4. 123milliseconds
    Member
    Posted 3 years ago #

  5. parham90
    Member
    Posted 3 years ago #

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

  6. spherical
    Member
    Posted 3 years ago #

    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?

  7. parham90
    Member
    Posted 3 years ago #

    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! :)

Topic Closed

This topic has been closed to new replies.

About this Topic