Child theme not inheriting parent theme
-
This is my first time using WordPress. I’m using the free premium theme Malaka on shared hosting at HostGator. I’ve added some pictures and customized the site a bit, but there are a few things in the layout that I don’t like, so I created the child theme to make my changes.
It appears that I created the child correctly since it shows up on the themes page, though it is displayed as an empty square while the other themes have an image “thumbnail.” Is that normal?
Do I want to activate the child theme or leave the original Malaka theme as active? When I activate the child theme, the color of the headers and some of the text change back to the original WordPress install colors. Shouldn’t the child theme inherit these colors from the parent theme? That’s what makes me think that things aren’t setup properly.
Here is the code at the top of my parent theme CSS:
Theme Name: Malaka Theme URL: https://www.fabthemes.com/malaka/ Author: Fabthemes.com Author URI: https://fabthemes.com/ Version: 1.0 License: GNU General Public License License URI: license.txt Text Domain: fabthemes Domain Path: /languages/ Tags:
Here is the code at the top of my child theme CSS:
Theme Name: Malaka Child Theme URL: https://www.fabthemes.com/malaka/ Author: Fabthemes.com Author URI: https://fabthemes.com/ Template: Malaka Version: 1.0 License: GNU General Public License License URI: license.txt Text Domain: fabthemes Domain Path: /languages/ Tags:
Here is my functions.php:
<?php function 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 ) ); } add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' ); ?>
Does everything look OK? I’ve been reading forums and documentation on child themes for the past 2 days, but being so new to WordPress, some of it just doesn’t make sense to me.
Thad
- The topic ‘Child theme not inheriting parent theme’ is closed to new replies.