0

I couldn't figure out how to change the font of the headings and the body after changing themes back to the default. (I feel like I had done it and then when I changed to a different theme and then back my customizations were lost and I couldn't figure out how to re-customize). So, I installed a plugin (but I feel like this is such a basic change). Am I missing something? How do I set basic styling like the font and size of a heading (H1, H2, H3, etc)?

Edit: I'm using the Twenty-Twenty-Two theme and hoping to import the google fonts without a plugin and also to make the H1, H2, body, ..etc.. styles consistent throughout the site and use those instead of modifying everything separately.

For reference this is the site I'm trying to create (it's currently only one page but will grow to be several pages) https://nationalparksatoz.com

4
  • You can @import font-family (if it's not added already) and then write custom CSS to headings, and body (eg. h1 {font-family: 'xxx'; font-size: 32px;}).
    – atiquratik
    Commented Sep 13, 2022 at 8:05
  • Are you using a child theme? Put your CSS in your style.css. ex: h1 { font-family: "Open Sans", sans-serif;font-size: 16px;}
    – rudtek
    Commented Sep 13, 2022 at 15:48
  • Ok.. so the font import should just work without the plugin? Where do I edit the global styles for my WP instance? It's not obvious to me the way a typical html + css site would be. Thanks!!
    – pixelfairy
    Commented Sep 13, 2022 at 17:32
  • After much frustration I've gone back to the plug-in ... I give up.
    – pixelfairy
    Commented Sep 13, 2022 at 20:27

1 Answer 1

1

if your are using child theme, you can edit your style.css and make you css code override ALL previous styling rules for that specific property on that element!.

h1 {
 font-family: 'xxx' !important;
 font-size: 32px !important;
}
6
  • thanks! I'll give it a try... Questions I still have are: Is Twenty-Twenty-Two a child theme? Where do I edit the main H1 style?
    – pixelfairy
    Commented Sep 13, 2022 at 19:31
  • @pixelfairy You can create a child theme for any theme. developer.wordpress.org/themes/advanced-topics/child-themes
    – AKEAmazan
    Commented Sep 13, 2022 at 19:37
  • sorry...I tried for an hour and I'm still stuck
    – pixelfairy
    Commented Sep 13, 2022 at 20:05
  • I added this to style.css @import url('fonts.googleapis.com/…); and lower down h1 { font-family: "Cabin", sans-serif !important; }
    – pixelfairy
    Commented Sep 13, 2022 at 20:06
  • comments don't support line breaks... hard to communicate here
    – pixelfairy
    Commented Sep 13, 2022 at 20:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.