Child theme not working (body)

I’m putting this in my child theme:

body {
font-family: serif;
}

But it doesn’t modify body text. If I use !important, it works, but I won’t do that.

Hey Daniel,

If you have added the CSS in the style.css of the child theme and do not see the changes, perhaps the site is loading the cached version of the style.css file.

Please apply the suggestions from this related thread:

Hope this helps.

Hi, I don’t really know what that’s talking about. I just installed everything, so everything is updated to its latest version.

I have a child theme. This is in it:

body {
font-family: monospace;
}

It doesn’t work. How do I get it to work? I’ve cleared my cache, and it still doesn’t work. When I put !important, it works, but I don’t want to do that. What is the point of having a child theme if it doesn’t work?

Hi Daniel,

Serif and monospace are not font-family, its a typefaces classification.

More details about typography classifications

Please navigate to Google Fonts, choose a category and choose an actual font.

Then navigate to Theme Options > Typography > Body Font and choose the font that you want for your body content.

If you want to load a Google font on your child theme manually, please follow this guide.

Also, make sure that your child theme is active.

Hope it helps,
Cheers!

Hi, it most definitely does not help. Perhaps you’re not reading carefully:

MY CHILD THEME DOESN’T WORK.

If I put:

body {
font-family: monospace;
}

It does not work. If I put:

body {
font-family: serif;
}

It does not work. If I put:

body {
font-family: Georgia; serif;
}

It does not work. If I put:

body {
font-family: Verdana; sans-serif;
}

It does not work. I repeat: MY CHILD THEME DOESN’T WORK.

Please try to understand what I am trying to communicate.

If I put:

body {
font-family: monospace!important;
}

It works. If I put:

body {
font-family: serif!important;
}

It works. If I put:

body {
font-family: Georgia, serif!important;
}

It works. If I put:

body {
font-family: Verdana; sans-serif!important;
}

It works. Something is wrong with my child theme because it only works if I put !important. PLEASE, PLEASE, try to understand me. PLEASE.

How do I fix this? PLEASE, try to understand. It doesn’t matter what css elements I use: body, spacing, paragraphs, headers, etc. Nothing works unless I use !important. I am not looking for advice on typefaces. I am trying to get help with my child theme not working. I used body as an example. PLEASE try to understand what I am trying to say.

I suspect that my child theme is not being loaded properly (or at the end). Perhaps theme.co’s child theme is wrongly made (or maybe it’s the functions.php file?) because I can only get elements to work if I use !important.

I got it to work. I created my own pro child theme, pasted in my stylesheet and put this in my functions.php file:

<?php function my_theme_enqueue_styles() { $parent_style = 'twentyseventeen-style'; $child-style = 'twentyseventeen-child-style'; wp_enqueue_style( $parent_style, get_template_directory_uri() . '/style.css' ); wp_enqueue_style( $child-style, get_stylesheet_uri() ); } ?>

Something is wrong with theme.co’s pro child theme. It does not work properly. Thanks for wasting my time. And I hope that theme.co will provide a properly functioning child theme in the future. Good day.

Hi Daniel,

Our child theme is used a lot, and we did not receive any report that it does not work until now. It could be just a CSS specificity issue.

The fact that when you add !important declaration on your CSS works, that means the child theme loaded the style.css properly.

Please learn the CSS Specificity and types of the CSS, if you want to use a child theme’s style.css file instead of the Theme Options > CSS.

Have a nice weekend,
Thanks,

1 Like

As it turns out, my solution didn’t work. It still requires me to use !important on some elements.

If I put the CSS in Pro’s theme options global css editor, it works just fine.

How can I make it so that my child theme can load last? I’d like for it to function properly. I don’t want to use Pro’s theme options global css editor. Thanks.

Never mind. Problem fixed. Ignore.

No problem.
If you need anything else we can help you with, don’t hesitate to open another thread.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.