Child theme not getting priority over parent style.css
-
Hello!
It might have been covered before, I don’t know. Just can’t find the answer anywhere on the net nor in the forums here. But I might just have missed it…
It’s getting me crazy, I’ve been on it for the whole day and can’t find the answer.Somehow the parent style.css keeps in control.
I want to change the width parameter to 100% instead of 1000px.
If I change it in the child style.css nothing happens. If I change it in the parent directly it does … but that’s just not the way it should be done …
I want to understand.If I make other alterations in the child css it does work, so the css is recognized I would say.
You can see my site: http://www.precies.net.
I try to nudge the logo to the left of the screen.My function.php:
********************************************
<?php
function my_theme_enqueue_styles() {$parent_style = ‘twentyseventeen-style’; // This is ‘twentyfifteen-style’ for the Twenty Fifteen theme.
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 ),
wp_get_theme()->get(‘Version’)
);
}
add_action( ‘wp_enqueue_scripts’, ‘my_theme_enqueue_styles’ );
?>
********************************************My child style.css:
********************************************
/*
Theme Name: precies
Theme URI: http://www.precies.net/precies/
Description: Twenty Seventeen Child Theme
Author: TJR
Author URI: http://example.com
Template: twentyseventeen
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Tags: light, dark, two-columns, right-sidebar, responsive-layout, accessibility-ready
Text Domain: precies
*/img{
max-width: 100%;
height: auto;
}.site-content {
background-image: url(“http://precies.net/typewriter-801917.jpg”);
background-repeat: no-repeat;
background-attachment: fixed;
background-size: cover;
}.wrap {
background-color: rgba( 250, 250, 250, 0.6)
}/*.site-branding {
display: none;*/
}wrap {
max-width: 100%;
padding-left: 3em;
padding-right: 3em;
}********************************************
The part in the parent style.css that overrules:
at line 3326
********************************************
/* Layout */.wrap {
max-width: 1000px;
padding-left: 3em;
padding-right: 3em;
}********************************************
any help or explanation would be greatly appreciated!
Cheers,
Taco
The topic ‘Child theme not getting priority over parent style.css’ is closed to new replies.