Creating child theme for classroom theme

Asked on April 21, 2017 in Customization.

Hi,
I am trying to create a child theme to customize the classroom theme.
I have created a child folder, layers-classroom-child. I have the following files:

style.css
“`
/*
Theme Name:   Classroom Child Theme
Description:  Classroom – WordPress Education Theme
Template:     layers-classroom
*/
“`

functions.php
“`
<?php

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' );
?>

“`

Quote:
where parent-style is the same $handle used in the parent theme when it registers its stylesheet. For example, if the parent theme is twentyfifteen, by looking in its functions.php for its wp_enqueue_style() call, you can see the tag it uses there is 'twentyfifteen-style'. In your child code, replace the instance of 'parent-style' with 'twentyfifteen-style', like so:

$parent_style = 'twentyfifteen-style';

I don’t know how to find $parent_style. I have looked at layers-classrom -> functions.php. I don’t see anything that is registering style…

Could you help? Thanks.

Regards,
yoyo

yoyo Layers User
Reply
0 Answer(s)