Title: PHP code in a page
Last modified: August 19, 2016

---

# PHP code in a page

 *  [ssmith162](https://wordpress.org/support/users/ssmith162/)
 * (@ssmith162)
 * [18 years, 3 months ago](https://wordpress.org/support/topic/php-code-in-a-page-2/)
 * 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)

 *  [Chris_K](https://wordpress.org/support/users/handysolo/)
 * (@handysolo)
 * [18 years, 3 months ago](https://wordpress.org/support/topic/php-code-in-a-page-2/#post-695043)
 * Check out [Pages](http://codex.wordpress.org/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.
 *  [_deek_](https://wordpress.org/support/users/_deek_/)
 * (@_deek_)
 * [18 years ago](https://wordpress.org/support/topic/php-code-in-a-page-2/#post-695391)
 * 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](http://wordpress.org/extend/plugins/exec-php/)
   > or [RunPHP](http://dev.wp-plugins.org/wiki/RunPHP).)
 * [http://codex.wordpress.org/Pages](http://codex.wordpress.org/Pages)
 *  [nibb42](https://wordpress.org/support/users/nibb42/)
 * (@nibb42)
 * [17 years, 11 months ago](https://wordpress.org/support/topic/php-code-in-a-page-2/#post-695401)
 * 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:
    - [Sniplets](http://wordpress.org/extend/plugins/sniplets/)
    - [Exec-php](http://http://wordpress.org/extend/plugins/exec-php/)
    - [http://wordpress.org/extend/plugins/hana-code-insert/](http://wordpress.org/extend/plugins/hana-code-insert/)
 * 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.

## Tags

 * [php](https://wordpress.org/support/topic-tag/php/)
 * [php code](https://wordpress.org/support/topic-tag/php-code/)
 * [static-page](https://wordpress.org/support/topic-tag/static-page/)

 * 3 replies
 * 4 participants
 * Last reply from: [nibb42](https://wordpress.org/support/users/nibb42/)
 * Last activity: [17 years, 11 months ago](https://wordpress.org/support/topic/php-code-in-a-page-2/#post-695401)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
