Results 1 to 2 of 2

Thread: clssipress3.03 function cp_style_changer() for child themes is still wrong

  1. #1
    Thread Starter
    Veteran bluecafe's Avatar
    Join Date
    Apr 2010
    Location
    Berlin
    Posts
    1,563
    Thanks
    58
    Thanked 359 Times in 273 Posts

    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 )

  2. #2
    Thread Starter
    Veteran bluecafe's Avatar
    Join Date
    Apr 2010
    Location
    Berlin
    Posts
    1,563
    Thanks
    58
    Thanked 359 Times in 273 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Child themes not possible
    By bluecafe in forum ClassiPress General Discussion
    Replies: 45
    Last Post: July 5th, 2012, 12:47 PM
  2. Child themes - how to ?
    By bluecafe in forum ClassiPress General Discussion
    Replies: 11
    Last Post: September 20th, 2010, 04:15 AM
  3. Child themes not possible
    By bluecafe in forum Report ClassiPress Bugs
    Replies: 8
    Last Post: December 31st, 1969, 06:00 PM