child theme css changes not working

Ask Theme Settings & Configuration Related Issues Here

Moderator: forum_m

milnewagg
Posts: 6
Joined: October 4th, 2014, 4:24 am

child theme css changes not working

Post by milnewagg » October 6th, 2014, 9:30 pm

Hi,

I installed weblizar-premium onto my host and created a child theme using your guide.
I activated the child theme but edits i make to the child theme style.css are not overwriting the parent style.

Here is the contents of my child style.css

/*
Theme Name: weblizar premium child
Theme URI:
Description: weblizar premium child
Author:
Author URI:
Template: weblizar-premium
Version: 1.0.0
Tags:
Text Domain: weblizar-premium-child
*/


@import url("../weblizar-premium/style.css");


/* =Theme customization starts here
-------------------------------------------------------------- */

.footer .footer-col .footer-title, .footer .copyright a:hover {
color: #6BD338;
}

The child stylesheet shows up in the wordpress appearance editor but changes are not implemented.

My website is www.landformlandscaping.co.uk

Thanks

milnewagg
Posts: 6
Joined: October 4th, 2014, 4:24 am

Re: child theme css changes not working

Post by milnewagg » October 6th, 2014, 11:31 pm

Silly me, the solution is to paste custom css into the appearance/weblizar options/general settings/custom css box.

User avatar
admin
Site Admin
Posts: 2880
Joined: June 5th, 2014, 1:03 am

Re: child theme css changes not working

Post by admin » October 7th, 2014, 5:07 pm

Hi Milne

The custom css box is use the little css customize.

But child theme is best option for customization.

CSS not overwrite parent theme. Then you can use !important tag in css code.

Fore example:

.footer .footer-col .footer-title, .footer .copyright a:hover {
color: #6BD338 !important;
}

Child theme css is worked.

Thanks

milnewagg
Posts: 6
Joined: October 4th, 2014, 4:24 am

Re: child theme css changes not working

Post by milnewagg » October 8th, 2014, 2:43 pm

Unfortunately pasting into my child's style.css has no effect either with or without the !important comment.

Here is a screenshot of the page with the custom style applied, notice it has no effect and the colour is bright green.
screen.jpg
Also a shot of my child theme style.css
screencss.jpg

When I paste the same line into the weblizar option custom css box the changes work when in the child's style.css they dont.

Perhaps my child theme is incorrectly configured?

Thanks.

User avatar
admin
Site Admin
Posts: 2880
Joined: June 5th, 2014, 1:03 am

Re: child theme css changes not working

Post by admin » October 8th, 2014, 5:24 pm

@ milnewagg : yes you are right , it sounds that your child theme is not configured in a correct way.

milnewagg
Posts: 6
Joined: October 4th, 2014, 4:24 am

Re: child theme css changes not working

Post by milnewagg » October 8th, 2014, 9:27 pm

Any suggestions for a fix?

User avatar
admin
Site Admin
Posts: 2880
Joined: June 5th, 2014, 1:03 am

Re: child theme css changes not working

Post by admin » October 9th, 2014, 3:09 pm

Hello milnewagg ,

The CSS works in Main Theme not in Child-Theme , Just because the you have coded the theme option from the Main Theme Not with the Child-Theme.

Thanks

milnewagg
Posts: 6
Joined: October 4th, 2014, 4:24 am

Re: child theme css changes not working

Post by milnewagg » October 9th, 2014, 6:47 pm

Looks like i have fixed it.
I'm a complete noob (I build gardens not websites). I googled it and pasted this into my child theme header.php :

'<style>
@import url("<?php bloginfo('template_url'); ?>/style.css");
@import url("<?php bloginfo('stylesheet_url'); ?>");
</style>'

Edit:

Only a partial fix. Some elements such as the menu and the image overlay on the porfolio are still using the parent style.

Could really use some advice.
Thanks

User avatar
admin
Site Admin
Posts: 2880
Joined: June 5th, 2014, 1:03 am

Re: child theme css changes not working

Post by admin » October 10th, 2014, 5:05 pm

@ milnewagg : your child-theme must enqueued your child theme's style.css file correctly.

All the CSS related changes must be done with in the child-themes style.css

User avatar
admin
Site Admin
Posts: 2880
Joined: June 5th, 2014, 1:03 am

Re: child theme css changes not working

Post by admin » October 10th, 2014, 5:05 pm

@ milnewagg : your child-theme must enqueued your child theme's style.css file correctly.

All the CSS related changes must be done with in the child-themes style.css

Post Reply

Return to “Theme Settings & Configuration”