Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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

2 Answers 2

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:

http://codex.wordpress.org/Function_Reference/get_template_part

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:

<?php
/**
 * 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

 
discard

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.