Title: Creating a Page WITH PHP code
Last modified: August 18, 2016

---

# Creating a Page WITH PHP code

 *  [warelf](https://wordpress.org/support/users/warelf/)
 * (@warelf)
 * [20 years, 4 months ago](https://wordpress.org/support/topic/creating-a-page-with-php-code/)
 * Hello,
    I’m trying to create a page on my wordpress page with PHP code in it..
   but but but the php code just pops up as code, and wordpress only handles the
   html code.
 * How do you add Pages with PHP in them? the code I’m trying to have on my site
   is:
 * <?php
    require(‘./bf2s-mlb.php’); $mlb->debug = true; $mlb->get(‘43937143,38233720,45056512,12700542,47991489,45131539,47991439,45131539,49282662,47991563,47694687,44603743,47898166’);?
   >
 * <?php $mlb->showList(‘SPM’); ?>

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

 *  [moshu](https://wordpress.org/support/users/moshu/)
 * (@moshu)
 * [20 years, 4 months ago](https://wordpress.org/support/topic/creating-a-page-with-php-code/#post-335529)
 * You have two options:
    1. Use the PHP in the template and create a new Page by
   using that template. 2. Find a plugin that will allow running PHP in Pages (or
   posts). Look for PHPExec, RunPHP, ExecPHP… [http://codex.wordpress.org/Plugins/Posts_Formatting](http://codex.wordpress.org/Plugins/Posts_Formatting)
 *  [davidjg](https://wordpress.org/support/users/davidjg/)
 * (@davidjg)
 * [20 years, 4 months ago](https://wordpress.org/support/topic/creating-a-page-with-php-code/#post-335546)
 * To add to moshu’s post:
 * If you’re going to be using the same code on a lot of pages, I’d suggest putting
   it in the template.
    If the code is different for each page, use a plugin.

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

The topic ‘Creating a Page WITH PHP code’ is closed to new replies.

 * 2 replies
 * 3 participants
 * Last reply from: [davidjg](https://wordpress.org/support/users/davidjg/)
 * Last activity: [20 years, 4 months ago](https://wordpress.org/support/topic/creating-a-page-with-php-code/#post-335546)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
