Title: Adding PHP Code in middle of post
Last modified: August 19, 2016

---

# Adding PHP Code in middle of post

 *  [ohdiesel](https://wordpress.org/support/users/ohdiesel/)
 * (@ohdiesel)
 * [16 years, 7 months ago](https://wordpress.org/support/topic/adding-php-code-in-middle-of-post/)
 * Hello,
 * Does anyone knoe of a plugin of a work-a-around that allows me to include PHP
   code into the middle of posts? Something like “related posts” in the middle of
   a single post would be what I’m looking for ..
 * Thanks!!

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

 *  [adamt07](https://wordpress.org/support/users/adamt07/)
 * (@adamt07)
 * [16 years, 7 months ago](https://wordpress.org/support/topic/adding-php-code-in-middle-of-post/#post-1286161)
 * [http://wordpress.org/extend/plugins/exec-php/](http://wordpress.org/extend/plugins/exec-php/)
 * that should do it
 *  Thread Starter [ohdiesel](https://wordpress.org/support/users/ohdiesel/)
 * (@ohdiesel)
 * [16 years, 7 months ago](https://wordpress.org/support/topic/adding-php-code-in-middle-of-post/#post-1286162)
 * Hello,
 * Thanks for repolying,
 * BUT will that do it automatically for me?
 *  [adamt07](https://wordpress.org/support/users/adamt07/)
 * (@adamt07)
 * [16 years, 7 months ago](https://wordpress.org/support/topic/adding-php-code-in-middle-of-post/#post-1286163)
 * related posts? no. that allows you execute php in a post. are you wanting something
   that will automatically show related posts?
 *  Thread Starter [ohdiesel](https://wordpress.org/support/users/ohdiesel/)
 * (@ohdiesel)
 * [16 years, 7 months ago](https://wordpress.org/support/topic/adding-php-code-in-middle-of-post/#post-1286164)
 * No, I mean, will it automaticlaly put things into middle or anywhere in the post
   as I choose with my own PHP code?
 *  Thread Starter [ohdiesel](https://wordpress.org/support/users/ohdiesel/)
 * (@ohdiesel)
 * [16 years, 7 months ago](https://wordpress.org/support/topic/adding-php-code-in-middle-of-post/#post-1286166)
 * Basically I am looking for something with the same functionality of Whydoworkadsense
   where it allows you to choose where to place ads on the fly.
 * IF Whydowork had the option to include PHP I would do it in a heart beat
 *  [adamt07](https://wordpress.org/support/users/adamt07/)
 * (@adamt07)
 * [16 years, 7 months ago](https://wordpress.org/support/topic/adding-php-code-in-middle-of-post/#post-1286167)
 * if you know how to write the code to accomplish what you are wanting to do, then
   try that plugin. i think you may have to switch to the html view, but you can
   place you <?php ?> tags anywhere you want within the post/page and it will execute
   it. i’m not 100% clear on what you’re wanting to be done automatically…
 *  Thread Starter [ohdiesel](https://wordpress.org/support/users/ohdiesel/)
 * (@ohdiesel)
 * [16 years, 7 months ago](https://wordpress.org/support/topic/adding-php-code-in-middle-of-post/#post-1286169)
 * Hello,
 * IN whydoworkadsense plugin you put in a code peice that is auto inserted into
   each post. I set mine into the middle.
 * That is what I want to do — insert a php code piece into middle of each post 
   and the output comes out like “related posts” and lists the related posts.
 * Thanks!!
 *  [adamt07](https://wordpress.org/support/users/adamt07/)
 * (@adamt07)
 * [16 years, 7 months ago](https://wordpress.org/support/topic/adding-php-code-in-middle-of-post/#post-1286171)
 * ohhh…ok i get what you’re asking now. i don’t know of a plugin off the top of
   my head that will do that. one way you could do it is writing it into the template,
   but then you would only have the option of placing it before the content or after.
   did you absolutely want it in the middle?
 *  Thread Starter [ohdiesel](https://wordpress.org/support/users/ohdiesel/)
 * (@ohdiesel)
 * [16 years, 7 months ago](https://wordpress.org/support/topic/adding-php-code-in-middle-of-post/#post-1286172)
 * Yes, I want it in the middle. I find it hard to beleive there are no plugins 
   to do this .. 🙂
 * D
 *  [adamt07](https://wordpress.org/support/users/adamt07/)
 * (@adamt07)
 * [16 years, 7 months ago](https://wordpress.org/support/topic/adding-php-code-in-middle-of-post/#post-1286176)
 * i didn’t say there wasn’t one, just that i don’t know of one off the top of my
   head.
 *  Thread Starter [ohdiesel](https://wordpress.org/support/users/ohdiesel/)
 * (@ohdiesel)
 * [16 years, 7 months ago](https://wordpress.org/support/topic/adding-php-code-in-middle-of-post/#post-1286221)
 * Anyone have any ideas ??g

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

The topic ‘Adding PHP Code in middle of post’ is closed to new replies.

 * 11 replies
 * 2 participants
 * Last reply from: [ohdiesel](https://wordpress.org/support/users/ohdiesel/)
 * Last activity: [16 years, 7 months ago](https://wordpress.org/support/topic/adding-php-code-in-middle-of-post/#post-1286221)
 * Status: not a support question

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
