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

My Emacs org-mode projects get exported to XHTML files. I would like to loosely integrate them into my blog. In particular, I'd like to use the header (and possibly footer) from my theme in the XHTML file.

Would it be possible to put something like <?php include("../blog-wp-content/themes/my-theme/header.php");?> (this obviously doesn't work) in my XHTML file to import the header from Wordpress? Are there other approaches to splicing the header with my file?

share|improve this question

You can't include a PHP file in XHTML file, simply change your XHTML file extension to .php in order to include a PHP file

share|improve this answer
up vote 0 down vote accepted

The key to answer was found on SO; here is the solution for my case:

create a PHP file with the following:

define('WP_USE_THEMES', false);
//Contents of the body of your XHTML page go here
<?php get_footer(); ?>

Now you have an external page in the format of your Wordpress theme.

share|improve this answer
it worked.. thanks a lot...!!! – user25547 Jan 4 '13 at 4:49

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.