• I am trying to create a static page to show use as my front page, but I want to put a bit of PHP code in it. When I put the code into the page it seems to erase the PHP aspects of the code.

    Is there anyone out there that can help me… please

Viewing 3 replies - 1 through 3 (of 3 total)
  • Check out Pages in the codex. In particular, read up on how to create your own Page template — you could add your custom PHP directly to the template before or after your content (if any).

    Or, you could do a quick search for one of the WordPress PHP plugins. There are a few out there so shouldn’t be too hard to turn one up.

    Hope that helps.

    Hey ssmith162,

    Hope this helps.

    Although you can put Template Tags and PHP code into a Page Template, you cannot put these into the content of a Page and expect them to run. (Note: You can achieve this by using a PHP evaluating Plugin such as Exec-PHP or RunPHP.)

    http://codex.wordpress.org/Pages

    Oddly enough there are a large number of plugins which are targeted at allowing you to execute PHP directly in Posts and Pages, two I have tried in the last week are:

    Both look excellent, both no longer work. They must have worked pre 2.5.1, but some change or other has been committed in 2.5.1 which essentially eradicates or messes with the embeded PHP you put in the post even with the plugins turned on. Indeed, the support forum for Exec-PHP seems to suggest a number of people are having problems specific to 2.1.5

    Annoying

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘PHP code in a page’ is closed to new replies.