I figured out a solution, and I’m posting it here in case someone else needs to do something similar with their blog.
I figured out I could access part of the PHP global variable $_SERVER, specifically $_SERVER[‘REQUEST_URI’], and compare that to my blog’s homepage url. If they are the same, I include my custom header template with the special content I want to appear _only_ on the homepage, else I include the standard header template for my blog theme.
Why is this better than querying the wordpress function is_home()? Because is_home() returns true even when you page through your older entries. My technique allows you to include custom content on your blog’s frontpage and _only_ on the frontpage.
Here’s the code:
<?php
$request_loc = 'https://www.yourdomainname.com';
$request_loc .= $_SERVER['REQUEST_URI'];
$blog_loc = get_bloginfo('url');
$blog_loc .= '/'; //wordpress seems to not allow trailing slashes on the blog url variable
if ( $request_loc == $blog_loc )
{
include (TEMPLATEPATH . '/your_custom_template.php');
}
else
{
get_header(); //include the standard header
}
?>