WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to create a custom page for my Wordpress blog that will execute my php code in it, whilst remaining a part of the overall site css/theme/design.

The php code will make use of 3rd party APIs (so I need to include other php files)

How do I accomplish this?

N.B. I do not have a specific need to interact with the Wordpress API - apart from including certain other php libs I need I have no other dependencies in the PHP code I want to include in a WP page. So obviously any solution that didn't require learning the WP api would be the best one.please help me to slove this problem.

share|improve this question
up vote 1 down vote accepted

Please refer to the Page Templates section of the Static Pages Codex entry.

Essentially, you create a custom page template, named something like template-foobar.php, which will live in your Theme's root directory, or in a one-deep sub-directory.

Inside this template file, add the following:

 * Template Name: Foobar




Now your template is available to be assigned to any static Page you create.

share|improve this answer

Create a custom page template, and add your code there. There is also an older article by Justin Tadlock about that topic.

Basically, you copy the page.php or single.php of your theme, add a header to it …

Template Name: Custom Page

… and your code.
In the back-end you select that template for the page you want to create.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.