parent theme css overrides child theme css
-
Hi
While I have seen this topic before, solutions offered have not resolved my issues. Perhaps I am overlooking something obvious (this is my 1st time implementing a child theme).
I followed the steps in this article (https://codex.ww.wp.xz.cn/Child_Themes) and set everything up. I AM able to activate the child theme and all appears to be ok (in regards to the site structure), however the parent theme css seems to trump any changes I make to the child theme css.
Below is the initial code for the parent theme css (located in themes>waxom>style.css)
/*
===============================================Theme Name: Waxom
Theme URI: http://themeforest.net/user/Veented
Description: Clean & Modern Multi-Purpose WordPress Theme.
Version: 1.2.5
Author: Veented
Author URI: http://themeforest.net/user/Veented
License: GNU General Public License
License URI: http://www.gnu.org/licenses/gpl-3.0.html
Tags: black, whiteTable of contents:
– CSS Reset
– General
– Columns & Layout
– Common
– Typography
– Header
– Blog
– Portfolio
– Footer
– Shortcodes & Plugins===============================================
*//* Reset */
Below is the initial code for the child theme css (located in themes>waxom-child>style.css)
/*
Theme Name: Waxom Child
Theme URI: http://themeforest.net/waxom-child/
Description: Waxom Child Theme
Author: Veented
Author URI: http://themeforest.net/user/Veented
Template: waxom
Version: 1.2.5
License: GNU General Public License
License URI: http://www.gnu.org/licenses/gpl-3.0.html
Tags: black, white
Text Domain: waxom-child
*/And here is the code used in the child php functions file (located in themes>waxom-child>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’ );
?>
The topic ‘parent theme css overrides child theme css’ is closed to new replies.