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.

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
add comment

2 Answers

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
add comment
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:

<?php
define('WP_USE_THEMES', false);
require('path/to/your-wordpress-dir/wp-blog-header.php');
get_header();
?>
//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
add comment

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.