Child theme looks nothing like parent theme
-
Hi there,
I’ve just encountered my first loss of custom styling via a parent theme update, so I want to do it right and create a child theme from which I can work in the future.
I’ve created the new directory in the Themes folder. My parent theme is Interface, and I’ve named my child theme Interface-child. So I have Themes>Interface-child>style.css. I have tried both the @import style sheet method as well as wp_enqueue_style() in a functions.php file.
Regardless, I cannot for the life of me get the child theme to look like the parent theme. I haven’t even made any changes to the styling…I figured I’d make sure the basic child setup works before making a bunch of changes.
Here’s what I’ve got in my style sheet:
/* Theme name: interface child Theme URI: https://ad-vax.com/ Description: This is a child theme of Interface Author: Ashley Williams Author URI: https://ad-vax.com/ Template: interface Version: 0.1 @import url('../interface/style.css'); */
Here’s the code for the functions.php:
<?php add_action( 'wp_enqueue_scripts', 'enqueue_parent_theme_style' ); function enqueue_parent_theme_style() { wp_enqueue_style( 'interface', get_template_directory_uri().'../interface/' ); } add_action( 'wp_enqueue_scripts', 'enqueue_child_theme_styles', PHP_INT_MAX); function enqueue_child_theme_styles() { wp_enqueue_style( 'interface', get_template_directory_uri().'../interface/style.css' ); wp_enqueue_style( 'interface-child', get_stylesheet_uri(), array('/style.css') ); }
Here’s a screenshot of the parent theme, which is currently active: https://ad-vax.com/wp-content/uploads/2014/12/parent-screenshot.png
Here’s a screenshot of the “live preview” of the child theme: https://ad-vax.com/wp-content/uploads/2014/12/child-screenshot.png
- The topic ‘Child theme looks nothing like parent theme’ is closed to new replies.