Child theme, obeying multiple style sheets in parent theme (specifically images)
-
I have a parent theme and I’ve created a child theme for it with a style sheet and an images folder. https://barnyarddesigner.com/
Two issues.
1. Images. I’ve edited the images (color scheme) and saved them as the same exact file name but put them into the child theme’s image folder. Am I correct in assuming the fix for the images that are being used in the parents style.css is to find every instance of a style that is calling an image and then put that style into the child style sheet?
For example the parent style.css has this
.bg {background: url(images/bg.jpg) center top repeat;}
so I need to just put this same exact thing into the child style sheet? (which I did, and it is pulling the image from the child’s folder VS the parents).
Just double checking that the fix is indeed doing a search in the parent style.css for anything /image and then just copying/pasting that style exactly as is into the child’s theme (again, because the images were edited/changed for color scheme).
2. Styles being defined from another style sheet withing in the parent’s css folder.
For example, the scroll arrows for the homepage’s slider – when you scale the browser down to a tablet size a different style sheet from the parent css folder is being used.
Of course there are some other styles that are non-image related that are coming from the various display size-specific style sheets.
What is the most efficient way to deal with this?
At first I tried copying the entire css folder (with all the .css files) into the child theme and it didn’t do any good.
Then I realized the header.php in the parent theme is calling multiple style sheets (8 total, not couting those for IE) using this:
<link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo( 'template_url' ); ?>/css/normalize.css" /> <link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo( 'stylesheet_url' ); ?>" /> <link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo( 'template_url' ); ?>/css/skeleton.css" /> <link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo( 'template_url' ); ?>/css/touchTouch.css" /> <link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo( 'template_url' ); ?>/css/768.css" />
In the end I was about ready to throw my hands up and just save the header.php file into the child theme and change the <?php bloginfo( ‘template_url’ ); ?> to <?php bloginfo( ‘stylesheet_url’ ); ?> based on something I read… but then I thought “Well does that defeat the purpose of using a child theme? I mean the header.php has some pretty significant info in it that the developer may change over time, eh?”.
Thanks so much for your replies. ??
- The topic ‘Child theme, obeying multiple style sheets in parent theme (specifically images)’ is closed to new replies.