Support » Theme: Twenty Nineteen » Child Theme and style.css

  • Resolved miakurt1

    (@miakurt1)


    My site is not picking up the style.css from the child theme. I had been adding my css changes in the customizer Additional CSS. But since there is a fair amount of css which I have added, I wanted to move it to the actual style.css in the child theme folder. But the css is not getting picked up. When I view source and look at style.css from the child theme, my css additions do not exist http://mysite.com/wp-content/themes/twentynineteen-child/style.css?ver=1.0.0

    Here is what I have –
    In style.css –
    /*
    Theme Name: Twenty Nineteen Child
    Theme URI: http://example.com/twenty-nineteen-child/
    Description: Twenty Nineteen Child Theme
    Author: John Doe
    Author URI: http://example.com
    Template: twentynineteen
    Version: 1.0.0
    License: GNU General Public License v2 or later
    License URI: http://www.gnu.org/licenses/gpl-2.0.html
    Tags: light, dark, two-columns, right-sidebar, responsive-layout, accessibility-ready
    Text Domain: twentynineteenchild
    */

    Then in function.php I added

    <?php
    add_action( ‘wp_enqueue_scripts’, ‘my_theme_enqueue_styles’ );
    function my_theme_enqueue_styles() {

    $parent_style = ‘parent-style’; // This is ‘twentynineteen-style’ for the Twenty Nineteen theme.

    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’)
    );
    }

    Am I missing something?

    Thanks

Viewing 5 replies - 1 through 5 (of 5 total)
  • Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Did you mean to mark this resolved? If so what was the solution?

    I needed to clear history on chrome and clear cache in safari on my mobile

    Question – If I were to only add this in my child theme style.css and leave the rest out, would I encounter problems on my site down the road. I am thinking of cases when there are updates to theme twenty nineteen.

    /*
    Theme Name: mynewsite
    Description: Twenty Nineteen Child Theme
    Template: twentynineteen
    */

    Technically only the Theme Name and Template rows are required for it to function. So the setup you have should be fine.

    Thanks Jarret

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.