Forums

Using PHP code in wordpress pages??? (3 posts)

  1. claytrainor
    Member
    Posted 3 years ago #

    Hi, What i am trying to do is pull a variable from a url, ie.

    http://www.example.com/index.php?Key=hello

    I'm able to do this on a normal php page with the following php code

    <?php echo str_replace('-', ' ', $_GET['Key'])?>

    But i can't seem to get it to function in wordpress.

    How would i go about doing this?

  2. MichaelH
    Volunteer
    Posted 3 years ago #

    If you put that code in a Template or use a exec PHP code plugin (i.e. so you can put code in posts) does it work?

  3. miktheguy
    Member
    Posted 3 years ago #

    execPHP did not work for WP 2.6.3 (at least on my installation) so I use runphp which works great!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags