Title: php and javascript in posts
Last modified: August 18, 2016

---

# php and javascript in posts

 *  [dave_merwin](https://wordpress.org/support/users/dave_merwin/)
 * (@dave_merwin)
 * [21 years ago](https://wordpress.org/support/topic/php-and-javascript-in-posts/)
 * Anyone know of a good plugin for running php in posts and or javascript in posts?
 * Lemme know.

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

 *  [yami](https://wordpress.org/support/users/yami/)
 * (@yami)
 * [21 years ago](https://wordpress.org/support/topic/php-and-javascript-in-posts/#post-199573)
 * I use [Run PHP](http://mark.scottishclimbs.com/archives/2004/07/02/running-php-in-wordpress-posts/).
 *  [Lorelle](https://wordpress.org/support/users/lorelle/)
 * (@lorelle)
 * [21 years ago](https://wordpress.org/support/topic/php-and-javascript-in-posts/#post-199591)
 * There is RunPHP and [http://www.navidazimi.com/projects/wp-exec](http://www.navidazimi.com/projects/wp-exec)
   will allow you to run PHP. You don’t need anything to run javascripts on a post–
   except you have to actually order the javascript like this:
 * `<script type="text/javascript" src="/scripts/top.js">
    <!-- top() //---></script
   >
 * So save the script in a script file and call it, don’t put the script code in
   the post.
 * And I would also reinforce this by running [TextControl plugin](http://dev.wp-plugins.org/wiki/TextControl)
   so you can set the formating to not convert the >< into character codes on a 
   per post basis.
 *  [ongakukaku](https://wordpress.org/support/users/ongakukaku/)
 * (@ongakukaku)
 * [20 years, 8 months ago](https://wordpress.org/support/topic/php-and-javascript-in-posts/#post-199862)
 * that code didn’t work on this one
 *  <script language=”JavaScript” type=”text/javascript”>
    <!–
 *  var username = “moshu”;
    var hostname = “moshu.com”; var linktext = “contact
   us by email”; document.write(“<a href=” + “mail” + “to:” + username + “@” + hostname
   + “>” + linktext + “”)
 *  //–>
 *  </script>
 *  [TechGnome](https://wordpress.org/support/users/techgnome/)
 * (@techgnome)
 * [20 years, 8 months ago](https://wordpress.org/support/topic/php-and-javascript-in-posts/#post-199863)
 * ongakukaku – yeah, I couldn’t get that to work either, butI did find that if 
   I use the syntax lorelle posted, it does work….
    Except that I did it like this:`
   <script type="text/javascript" src="/scripts/top.js"></script>
 * -tg
 *  [Beel](https://wordpress.org/support/users/beel/)
 * (@beel)
 * [20 years, 8 months ago](https://wordpress.org/support/topic/php-and-javascript-in-posts/#post-199864)
 * [http://wordpress.org/support/topic/39576](http://wordpress.org/support/topic/39576)
 * [CG-QuickPHP](https://wordpress.org/support/topic/36664?output_format=md)
 *  [Lorelle](https://wordpress.org/support/users/lorelle/)
 * (@lorelle)
 * [20 years, 8 months ago](https://wordpress.org/support/topic/php-and-javascript-in-posts/#post-199865)
 * For information on running Javascript, see [Using Javascript](http://codex.wordpress.org/Using_Javascript).
   In order to run PHP inside of posts, something not recommended, you can use RunPHP
   or PHPExec, both found here:
    [http://codex.wordpress.org/Plugins/Posts_Formatting](http://codex.wordpress.org/Plugins/Posts_Formatting)
 *  [ongakukaku](https://wordpress.org/support/users/ongakukaku/)
 * (@ongakukaku)
 * [20 years, 8 months ago](https://wordpress.org/support/topic/php-and-javascript-in-posts/#post-199866)
 * that format didn’t work for me, kind of makes sense though that some javascript
   wouldn’t work in pages, since the page is not a real page, just content spit 
   out from the database
 *  [ongakukaku](https://wordpress.org/support/users/ongakukaku/)
 * (@ongakukaku)
 * [20 years, 8 months ago](https://wordpress.org/support/topic/php-and-javascript-in-posts/#post-199867)
 * i finally got this one to show up on the page
 * <script language=”JavaScript” type=”text/javascript”>
    <!–
 * var username = “moshu”;
    var hostname = “moshu.com”; var linktext = “contact 
   us by email”; document.write(“<a href=” + “mail” + “to:” + username + “@” + hostname
   + “>” + linktext + “”)
 * //–>
 * </script>
 * the only problem now is, it shows up at the very top of the page moving the wp
   layout down below it.
 * I tried using a div tag but the javascript doesn’t seem to be formatable via 
   the css
 * anyone have any ideas how to drop the email down into the page where it belongs?

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

The topic ‘php and javascript in posts’ is closed to new replies.

## Tags

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

 * 8 replies
 * 6 participants
 * Last reply from: [ongakukaku](https://wordpress.org/support/users/ongakukaku/)
 * Last activity: [20 years, 8 months ago](https://wordpress.org/support/topic/php-and-javascript-in-posts/#post-199867)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
