Problems with empty child
-
I made a child theme for TwentySeventeen, and noticed that even though the style.css had no css yet, just activating the child theme made my site appear differently. I would have thought that at that point, the site would appear the same.
THe difference is that when TwentySeventeen is active, the page title and page content appear in a single column. When the child theme is active, the page title is on the left and the page content on the right.
I would have thought that if there is no css in the child theme, that the parent theme would determine all aspects of how the pages are displayed.
The style.css is:
/*
Theme Name: Twenty Seventeen Child Theme
Description: A child theme for use with WordPress Twenty Seventeen Theme.
Author: me
Author URI: me
Template: twentyseventeen
Version: 1.0.0
*//* Add Custom CSS after this line */
The functions.php is:
<?php
function mytheme_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 )
);
}
add_action( ‘wp_enqueue_scripts’, ‘mytheme_enqueue_styles’ );
?>
- The topic ‘Problems with empty child’ is closed to new replies.