• I’m usually OK with CSS and the Site Editor but the titles on this archive page have me puzzled.
    The default titles are too big and heavy for my liking, but try as I might, I cannot alter the font weight – either with CSS or in the (Archive) Site Editor.

    This is the CSS I’m using. Font size and family work OK, but not font weight:

    h2 {
    	font-family: Sans-serif;
    	font-size: 24px !important;
      font-weight: 500 !important;
    }

    Whether or not I include ‘wp-block-post-title’ makes no difference either.

    In the Site Editor, changing title font weights in the Archive template has no effect either.

    Any help would be very welcome.
    Andy

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • I think the “correct” way to do it is to set up typography in the theme.json file. I am new to this theme but had the same situation where I wanted to reduce the sizes of the largest headings. I copied the “fontSizes” section from the parent theme’s theme.json, into the child theme’s theme.json. I was able to turn down the font sizes associated with the “XL” and “XXL” buttons.

    "fontSizes": [
    				{
    					"fluid": {
    						"min": "0.875rem",
    						"max": "1rem"
    					},
    					"size": "1rem",
    					"slug": "small"
    				},
    				{
    					"fluid": {
    						"min": "1rem",
    						"max": "1.125rem"
    					},
    					"size": "1.125rem",
    					"slug": "medium"
    				},
    				{
    					"fluid": {
    						"min": "1.75rem",
    						"max": "1.875rem"
    					},
    					"size": "1.75rem",
    					"slug": "large"
    				},
    				{
    					"fluid": false,
    					"size": "1.9rem",
    					"slug": "x-large"
    				},
    				{
    					"fluid": {
    						"min": "2rem",
    						"max": "4rem"
    					},
    					"size": "4rem",
    					"slug": "xx-large"
    				}

    sorry for the bad formatting, but if you look at the parent theme.json you should be able to get an idea of what’s possible (including setting the font weight).

    • This reply was modified 1 year, 1 month ago by Bunny Blake.
    Moderator Felipe Santos

    (@foosantos)

    Also, if you only want to edit this on this specific site from your interface, you can go to the Site Editor > Templates > All Archives, then you can manually set your specific title size there.

    It should work as expected there. I tested from my end now, and worked perfectly.

    Thread Starter andynick

    (@andynick)

    Thank you @h_double – and apologies for the late response. I’m afraid your suggestion is way beyond me! I prefer to change the font sizes in the Editor or with CSS if I can. That often stretches my limited brain, withouth venturing into theme.json.
    But thank you for trying to help.

    Thread Starter andynick

    (@andynick)

    Thank you also to @foosantos.
    I cannot see an “All Archives” option within Site Editor > Templates in Twenty Twenty Three.
    Am I missing something?
    (I did mention in my OP that “changing title font weights in the Archive template has no effect either”.
    Apologies to you as well, for the late reply. I don’t get an email even though I checked the “Notify” box below.

    • This reply was modified 1 year ago by andynick. Reason: Added paragraph about having tried to change font weights in the Editor
    Moderator Felipe Santos

    (@foosantos)

    Hi @andynick,

    I believe the reason that it didn’t work initially was because you likely had it overwritten on a different archive.

    My understanding is that you want to apply it to all archives, not all h2 elements on the whole site, right?

    If that’s the case, it should indeed work by changing on this specific template.

    Is that where you’re trying to check this?

    https://d.pr/i/kkswk8
    Full Size: https://d.pr/i/kkswk8

    If so, can you try going here: example.com/wp-admin/site-editor.php?postType=wp_template&postId=twentytwentythree%2F%2Farchive

    Change example.com to your url.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Unable to change h2 font weight with CSS or Site Editor’ is closed to new replies.