The header.php file is one of the most important files in the WordPress themes directory. The file generates critical HTML header information. One of the header tags contains the link a browser uses to style the HTML document. If you work between a test bed and an online site, you need to be *very* careful that this link is correct for the stylesheet location.
I recently downloaded several files from my online blog to the test bed I use for blog development. I did this in order to insure that the files, including style.css, were identical at both locations.
Normally, the header.php code determines the appropriate links for the header section of the generated HTML document. However, for my online site, and after reading “Speed up and clean up your WordPress,” I filled in the actual links to make them static and speed up the WordPress loading process. The author of the article, Joost de Valk, says this:
Because themes have to be easy to spread, they have to get almost all the blog specific info from the database. That results in a lot of queries for stuff that you could just hardcode into the theme.
The “out of the box” header.php contains this code to generate the link to the stylesheet:
<link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />
After downloading the files from my online blog, the header.php that replaced the file on my test bed and which had been altered to include static links contained this link to the stylesheet:
<link rel="stylesheet" href="http://www.blog.selectdigitals.com/wordpress/wp-content/
themes/default/style.css" type="text/css" media="screen" />
I did not notice this for a frustrating day or two. I tried to make several styling changes in my local copy of style.css—but the changes never made it to my browser’s display!
Eventually, I noticed that the browser was not looking at the style.css file on my test bed but was always retrieving the stylesheet from my online blog. Once I discovered this and corrected the header.php file to show the right link to my local stylesheet, the changes began to alter the HTML display as expected.