clssipress3.03 function cp_style_changer() for child themes is still wrong
Hi,
I really appreciate encouraging child themes and I am looking forward to the child theme market which I think is a really cool idea.
However, the main requirement to include child themes is still not working because the function cp_style_changer(); in theme-functions.php has still wrong conditions.
The way the function cp_style_changer(); is working presently is "if stylesheets are turned off include custom.css" ... but this is NOT the way how child themes work.
The correct function should read "if stylesheets are turned ON AND if there is a custom.css include custom.css.
If stylesheets are turned OFF DO NOT include custom.css (because custom.css has nothing to do with a child theme) but include stylesheetpath of the child theme (not custom.css!). The stylesheetpath of the child theme is missing in this function (custom.css is NOT the childtheme stylesheet)
In order to work with child themes the function should read
// changes the css file based on what is selected on the options page
function cp_style_changer() {
// turn off stylesheets if customers want to use child themes
if (get_option('cp_disable_stylesheet') <> 'yes') {
if (get_option('cp_stylesheet')) {
echo '<link href="' . get_bloginfo('template_directory') . '/styles/' . get_option('cp_stylesheet') . '" rel="stylesheet" type="text/css" />' . "\n";
// include the custom stylesheet
echo '<link href="'. get_bloginfo('template_directory') .'/styles/custom.css" rel="stylesheet" type="text/css" />' . "\n";
} else {
echo '<link href="' . get_bloginfo('template_directory') . '/styles/red.css" rel="stylesheet" type="text/css" />' . "\n";
// include the custom stylesheet
echo '<link href="'. get_bloginfo('template_directory') .'/styles/custom.css" rel="stylesheet" type="text/css" />' . "\n";
}
}
else {
echo '<link href="' . get_bloginfo('stylesheet_directory') . '/styles.css" rel="stylesheet" type="text/css" />' . "\n";
}
}
(as already mentioned here
http://appthemes.com/forum/showthrea...ll=1#post31631 )