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?

2 Answers 2


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.


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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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