I have comments again, YAY ME!
Not that anyone leaves comments… buuut…
When I upgraded to WordPress2, I had a hard time making a flexible theme, so I ditched that idea and decided to parse the code myself (like I did with the original WordPress). The problem? My individual posts no longer had comments. (UH OH!)
So how do you make a theme that is flexible with your Domesticat-like skinning abilities?
You make a theme inside a theme, of course.
- Open your wp-content/themes/[yourtheme]/header.php file
- Put in your skinning information in the header like you usually do.
- Open your wp-content/themes/[yourtheme]/footer.php file
- Hard code the variable information that you need, particularly this part…
$total_skins = 3;
$default_skin = 3;
if (isset($_REQUEST[‘newskin’])) {
$newskin=(int)$_REQUEST[‘newskin’];
if ( ($newskin<1) OR ($newskin>$total_skins) ) $newskin=$default_skin;
$skin=$newskin;
} elseif (isset($_COOKIE[‘skin’]))
$newskin = $_COOKIE[‘skin’];
elseif (isset($_REQUEST[‘newskin’])) {
$newskin=(int)$skin;
if ( ($newskin<1) OR ($newskin>$total_skins) ) $newskin=$default_skin;
} else $newskin=$default_skin;
include(‘/home/yoursite/public_html/skins/$skin/footer.php’);
?>
</body>
</html>
That part is the one that tells your theme what skin the reader has selected using. (It’s slightly changed from the Domesticat version as you can’t set cookies in the footer.).
For whatever reason, WordPress kills all your variables right after it does its thing. You need to re-code your variables in the footer as well.