• I created a child theme using the Child Theme Configurator plugin and noticed that if I enter any new CSS code in the style sheet it has no effect on the theme, but if I add the same code in the Additional CSS box within the Theme Customizer it will work. Has anyone else noticed this with Child Themes for twenty seventeen? I guess I could just keep using the Customizer to make modifications although it kind of defeats the purpose of using a child theme, except for the ability to change the footer text which is handy.

    • This topic was modified 8 years, 1 month ago by videosc.
Viewing 7 replies - 1 through 7 (of 7 total)
  • Can you post a link to your site with the child theme active?

    Thread Starter videosc

    (@videosc)

    I already switched to another theme until this issue gets resolved. Not sure why you would need to see the site anyhow because all I’m asking is if anyone else has experienced the same issue as me with a child theme of twenty seventeen.

    If it helps here is the code on my child theme style.css file:

    /*
    Theme Name: Twenty Seventeen Child
    Theme URI: https://www.ads-software.com/themes/twentyseventeen/
    Template: twentyseventeen
    Author: the WordPress team
    Author URI: https://www.ads-software.com/
    Description: Twenty Seventeen brings your site to life with header video and immersive featured images. With a focus on business sites, it features multiple sections on the front page as well as widgets, navigation and social menus, a logo, and more. Personalize its asymmetrical grid with a custom color scheme and showcase your multimedia content with post formats. Our default theme for 2017 works great in many languages, for any abilities, and on any device.
    Tags: one-column,two-columns,right-sidebar,flexible-header,accessibility-ready,custom-colors,custom-header,custom-menu,custom-logo,editor-style,featured-images,footer-widgets,post-formats,rtl-language-support,sticky-post,theme-options,threaded-comments,translation-ready
    Version: 1.1.1486332046
    Updated: 2017-02-05 22:00:46
    
    */

    The main reason I wanted to see the site is to see what code the plugin was outputting and also to see if there were any other errors that might have affected your child theme. It could have also been a caching issue; even if you don’t use a caching plugin, your host may have been caching your site.

    Thread Starter videosc

    (@videosc)

    The Child Theme Configurator plugin only created two files, style.css and functions.php. Here is the functions php code:

    <?php
    // Exit if accessed directly
    if ( !defined( 'ABSPATH' ) ) exit;
    
    // BEGIN ENQUEUE PARENT ACTION
    // AUTO GENERATED - Do not modify or remove comment markers above or below:
    
    if ( !function_exists( 'chld_thm_cfg_parent_css' ) ):
        function chld_thm_cfg_parent_css() {
            wp_enqueue_style( 'chld_thm_cfg_parent', trailingslashit( get_template_directory_uri() ) . 'style.css', array(  ) );
        }
    endif;
    add_action( 'wp_enqueue_scripts', 'chld_thm_cfg_parent_css', 10 );
    
    // END ENQUEUE PARENT ACTION

    Are you able to tell from these code posts if anything is preventing the child theme from working?

    I assumed it wasn’t a caching issue because I could add several CSS changes to the Customizer Additional CSS box and each worked fine.

    As an example when I added h2.widget-title {color: #fff;} to the child theme style.css nothing changed but when I deleted it and added it to the customizer additional css box the widget title color changed from black to white.

    I assume Twenty Seventeen is one of the more popular WordPress themes so it seems odd that more people aren’t reporting issues with child themes, which makes me wonder if the problem is in the code I used.

    Thread Starter videosc

    (@videosc)

    Just an FYI that I found some other functions php codes to try (below) and it didn’t work either. Found one example here: https://codeboarding.com/2017/01/17/wordpress-twenty-seventeen-theme-customization/

    <?php
    /* Child theme mandatory code */
    function my_theme_enqueue_styles() {
        $parent_style = 'parent-style';
        wp_enqueue_style( $parent_style, get_template_directory_uri() . '/style.css' );
        wp_enqueue_style( 'child-style',
            get_stylesheet_directory_uri() . '/style.css',
            array( $parent_style ),
            wp_get_theme()->get('Version')
        );
    }
    add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles' );
    ?>

    And another example here: https://kinsta.com/blog/twenty-seventeen-theme/

    <?php
    /* Child theme mandatory code */
    function childtheme_enqueue_styles() {
    wp_enqueue_style( 'parent-style', 
    get_template_directory_uri() . '/style.css' );
    
    wp_enqueue_style( 'child-style',
    get_stylesheet_directory_uri() . '/style.css',
    array( 'parent-style' ),
    wp_get_theme()->get('Version')
    );
    }
    add_action( 'wp_enqueue_scripts', 'childtheme_enqueue_styles' );
    ?>

    Interesting that there seem to be several functions php suggestions for this theme floating around the internet.

    • This reply was modified 8 years, 1 month ago by videosc.

    Interesting that there seem to be several functions php suggestions for this theme floating around the internet.

    True. Mine is too different from others. So, I don’t want to create more confusion for a simpler problem.

    Sorry to ask this dump question… but, did you activate the child theme?

    I am having the same issue and I have tried everything I can think of. I can edit in “additional CSS” just fine, but when I edit style.css in my child theme, nothing changes.

    For example, I was able to get waywetrip.com/sample-page to show full width by adding this to the “additional CSS” section, but same thing wouldn’t work in style.css.

    @media screen and (min-width: 48em) {
    body.page-template-page-full-width .page-full-width #primary .entry-content {
    width: 100%;
    }

    body.page-template-page-full-width .page-full-width #primary .entry-header {
    width: 100%;
    }

    body.page-template-page-full-width .entry-header #primary .entry-title {
    font-size: 5rem;
    font-size: 80px;
    }
    }

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Child Theme CSS Problems or Bug?’ is closed to new replies.