Title: php include not activating inside a post
Last modified: August 19, 2016

---

# php include not activating inside a post

 *  [nagzul](https://wordpress.org/support/users/nagzul/)
 * (@nagzul)
 * [16 years, 8 months ago](https://wordpress.org/support/topic/php-include-not-activating-inside-a-post/)
 * Hi, I have some php includes in my post. I’m assuming because of the dom structure
   of loading the php codes wont trigger inside a post.
    So how can I do this? Maybe
   an on load event or java script, I’m clueless can someone help me?
 * Basically I made a mini “template” to post in my posts, and compacted it into
   10 php include files.
    That’s the jiff, so I await for some recommendations.

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

 *  [jon](https://wordpress.org/support/users/adiant/)
 * (@adiant)
 * [16 years, 8 months ago](https://wordpress.org/support/topic/php-include-not-activating-inside-a-post/#post-1212052)
 * For security reasons, WordPress chose to not allow php code in the text of Posts
   or Pages you create. The two common ways “around” this are:
    1. Plug-ins written by individuals (not the WordPress development team) specifically
       to allow php code in Posts or Pages
    2. Create your own Template file by modifying existing ones in your chosen Theme,
       typically single.php for Posts and page.php for Pages, either replacing the 
       existing files or having custom ones that you have to select each time you create
       a post or page.
 * The plug-in directory is here: [http://wordpress.org/extend/plugins/](http://wordpress.org/extend/plugins/)
 * The best place to start to read about Template files is here: [http://codex.wordpress.org/Stepping_Into_Templates](http://codex.wordpress.org/Stepping_Into_Templates)
 * Personally, I choose a third approach: I used Custom Fields to store php, and
   inserted it in posts, pages and elsewhere using double square bracks around the
   Custom Field name. But that required me to change templates and write a function(
   in php) to look for double square brackets in the content of each post or page.
 *  [Samuel B](https://wordpress.org/support/users/samboll/)
 * (@samboll)
 * [16 years, 8 months ago](https://wordpress.org/support/topic/php-include-not-activating-inside-a-post/#post-1212082)
 * [http://wordpress.org/extend/plugins/exec-php/](http://wordpress.org/extend/plugins/exec-php/)
 *  Thread Starter [nagzul](https://wordpress.org/support/users/nagzul/)
 * (@nagzul)
 * [16 years, 8 months ago](https://wordpress.org/support/topic/php-include-not-activating-inside-a-post/#post-1212150)
 * Thank you guys.

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

The topic ‘php include not activating inside a post’ is closed to new replies.

## Tags

 * [have](https://wordpress.org/support/topic-tag/have/)
 * [load](https://wordpress.org/support/topic-tag/load/)
 * [on](https://wordpress.org/support/topic-tag/on/)
 * [php](https://wordpress.org/support/topic-tag/php/)
 * [trigger](https://wordpress.org/support/topic-tag/trigger/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 3 replies
 * 3 participants
 * Last reply from: [nagzul](https://wordpress.org/support/users/nagzul/)
 * Last activity: [16 years, 8 months ago](https://wordpress.org/support/topic/php-include-not-activating-inside-a-post/#post-1212150)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
