Quantcast
Channel: WordPress.org Forums » All Topics
Viewing all articles
Browse latest Browse all 504799

Parent theme css overriding child css rules

$
0
0

Replies: 0

This seems like a common problem but as I modify my child themes style.css the parent style.css rules override any changes I make.

One of the main solutions seems to be correctly enqueue your functions.php file. I have no experience in php but I have copy and pasted a number of versions of doing so with no luck. Here is my functions.php code in my child theme folder.

<?php
//
// Recommended way to include parent theme styles.
//  (Please see http://codex.wordpress.org  /Child_Themes#How_to_Create_a_Child_Theme)
//
add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' );
function theme_enqueue_styles() {
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')
);
}
//
// Your code goes below
//

My parent theme is Adios.

I am locally hosting my site so I can’t share a link to it.


Viewing all articles
Browse latest Browse all 504799

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>