Friday, September 28, 2012

How To: Trick WordPress into pulling in your header

I can't take credit for this one, my boss figured this out.

Let's say you want to use a header file from somewhere on your site as the same header for your WordPress blog, but it's a .shtml header or something and WordPress is whining about php again.

With Apache, you can just put the following into/as the "header.php" file in your WordPress theme:
<?php
apache_setenv("Title", "TITLE");
apache_setenv("Description", "DESCRIPTION");
virtual("LOCATION");
?>
Where TITLE is your desired blog title (text), DESCRIPTION is your desired description (also as just text), and LOCATION is the location of the silly thing (file path).