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 have a page on my site that is not a page in WordPress. How can I add it to the header?

EDIT: The page is .php. It is outside of the theme structure.

share|improve this question
need some more information. is the page .html? .php? Is it in your theme file structure, or somewhere else? – timshutes Mar 19 '13 at 2:06
See edit above. – B Seven Mar 19 '13 at 2:09
I'm assuming it must stay outside the theme structure? on the same server though? – timshutes Mar 19 '13 at 2:10
I guess it doesn't need to stay outside the theme structure... – B Seven Mar 19 '13 at 2:11
ok took a stab. assuming the file can be moved within the theme structure. – timshutes Mar 19 '13 at 2:13

The code you want is:

<?php include 'yourfile.php' ?>

Place the file in the same directory as header.php.

EDIT: depending on the nature of the content, and how often you will reuse, you may also choose to use this:


share|improve this answer

You can simply add a template header comment and add your site as Page Template.

Just add the following line on top of your file:

 * Template Name: My lovely standalone page

Then add another page and choose your new template from the dropdown/select on the meta box on the right. You don't have to add any content or anything (I'd add a title in case it gets used) and your site will be integrated straight into WordPress. You then can even add it to menus, etc.

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.