Title: PHP code inside posts?
Last modified: August 18, 2016

---

# PHP code inside posts?

 *  [rvoogdgeert](https://wordpress.org/support/users/rvoogdgeert/)
 * (@rvoogdgeert)
 * [20 years, 3 months ago](https://wordpress.org/support/topic/php-code-inside-posts/)
 * Dear wordpress users,
 * Does any of you have any experience with using PHP code inside posts? I tried
   two plug ins that completely messed up a post with some code (In WordPress 2.01)
   which syntax was absolutely correct.
 * Any suggestion?

Viewing 7 replies - 16 through 22 (of 22 total)

[←](https://wordpress.org/support/topic/php-code-inside-posts/?output_format=md)
[1](https://wordpress.org/support/topic/php-code-inside-posts/?output_format=md)
2

 *  [WPChina](https://wordpress.org/support/users/wordpresschina/)
 * (@wordpresschina)
 * [20 years, 3 months ago](https://wordpress.org/support/topic/php-code-inside-posts/page/2/#post-342618)
 * Sorry, I should have said “My French is crêpe”.
 * Yes, I tried all sorts of things like changing permalinks to add a “.php” to 
   all links to make it possible to pass variables.
 * For example, I want to do this:
 * 1) Pass a variable for “name” on a URL in my blog like [http://localhost/blog/posts/my-post.php?name=Jean-Francois](http://localhost/blog/posts/my-post.php?name=Jean-Francois)
 * 2) Embedded in my Post or Page is a short bit of PHP code that grabs that variable“?
   name=Jean-Francois” and displays the name.
 * Simple. It works of course in flat PHP/HTML, but using WP causes problems. I 
   am stumped.
 *  [tijmen](https://wordpress.org/support/users/tijmen/)
 * (@tijmen)
 * [20 years, 3 months ago](https://wordpress.org/support/topic/php-code-inside-posts/page/2/#post-342623)
 * Hmm. That works for me. I use blabla.com/?page_id=1&thing=2&id=34322, and this
   in the code:
 * `$thing = $_GET["thing"];
    $id = $_GET["id"];
 * I only use it on static pages, but that shouldn’t make a difference I think.
 *  [MichaelH](https://wordpress.org/support/users/michaelh/)
 * (@michaelh)
 * [20 years, 3 months ago](https://wordpress.org/support/topic/php-code-inside-posts/page/2/#post-342624)
 * Or this plugin?
 * CG-QuickPHP
    [http://www.chait.net/index.php?p=310](http://www.chait.net/index.php?p=310)
 *  [davidchait](https://wordpress.org/support/users/davidchait/)
 * (@davidchait)
 * [20 years, 3 months ago](https://wordpress.org/support/topic/php-code-inside-posts/page/2/#post-342630)
 * Thanks Michael, was just about to post a link myself! 😉
 * QuickPHP is really targeted for single function calls or include statements (
   it does one ‘method’, with a parenthesized parameter list), constant arguments.
   But including a php script is then really easy, or calling a function (like any
   basic WP func..).
 * I use it for embedding things like CG-FeedRead feeds, or wacky CG-Amazon stuff(
   since CG-Inline already has an amazon tag).
 * -d
 *  [WPChina](https://wordpress.org/support/users/wordpresschina/)
 * (@wordpresschina)
 * [20 years, 3 months ago](https://wordpress.org/support/topic/php-code-inside-posts/page/2/#post-342818)
 * Ahhh, relief. Got it to work. My stupid stupid problem was that I failed to tick
   the little “run PHP code?” box on the Write Post and Write Page area. Stupid 
   me. Ok, now it’s done and it works. Ah!
 * Stupid me…
 *  [vkaryl](https://wordpress.org/support/users/vkaryl/)
 * (@vkaryl)
 * [20 years, 3 months ago](https://wordpress.org/support/topic/php-code-inside-posts/page/2/#post-342820)
 * Well, hey…. at least you got it working now. And thanks VERY much for posting
   back, so the next poor soul can (maybe – since goddess only knows how long search
   will be broke herein) find the help heesh needs….
 *  [WPChina](https://wordpress.org/support/users/wordpresschina/)
 * (@wordpresschina)
 * [20 years, 3 months ago](https://wordpress.org/support/topic/php-code-inside-posts/page/2/#post-342835)
 * No problem… but it took me a DAY to figure out that I forgot to tick that darn
   box. I am still shaking my head. I didn’t sleep well last night because of it.
   Stupid stupid mistake.
 * Yes, runPHP works very well for passing variables. I have not tried any of the
   other PHP addons, but assume they work well too.

Viewing 7 replies - 16 through 22 (of 22 total)

[←](https://wordpress.org/support/topic/php-code-inside-posts/?output_format=md)
[1](https://wordpress.org/support/topic/php-code-inside-posts/?output_format=md)
2

The topic ‘PHP code inside posts?’ is closed to new replies.

## Tags

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

 * 22 replies
 * 7 participants
 * Last reply from: [WPChina](https://wordpress.org/support/users/wordpresschina/)
 * Last activity: [20 years, 3 months ago](https://wordpress.org/support/topic/php-code-inside-posts/page/2/#post-342835)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
