• Resolved msouthon

    (@msouthon)


    I’m using a google font in my wp theme.

    I placed the following code in the header.php:

    <link href='https://fonts.googleapis.com/css?family=Roboto&subset=latin,cyrillic-ext,greek-ext,greek,vietnamese,latin-ext,cyrillic' rel='stylesheet' type='text/css'>

    and the following code in the style.css:

    body {
            font-family: 'open sans', sans-serif;
            font-size: 15px;
            color: #555;
          }

    The result is that the google font is displaying okay.

    However, I cannot change the font-size. I’ve tried various different ways of specifying the font-size (100%, em, px, etc) and it is completely unresponsive.

    Any ideas as to what I am doing wrong?

    Thanks in advance.

Viewing 8 replies - 1 through 8 (of 8 total)
  • Can you post a link to your site?

    Thread Starter msouthon

    (@msouthon)

    sorry about that, here is the link:

    https://www.wpmediadesign.com

    Thanks

    You have this piece of CSS in your <head> section, on line 56, which is overriding your font size in your stylesheet:

    body { font-size: 15px; }

    Unfortunately, I can’t identify how that particular piece of code was added to your site. You might consider temporarily deactivating all your plugins and also checking your theme’s options to see if any of them added that CSS.

    Thread Starter msouthon

    (@msouthon)

    Thanks, when you say <head> section, is that the header.php?

    Yes, but it could also have been added by a function hooked to wp_head() in your functions.php, or a plugin that hooks to wp_head(), or a theme option. Unfortunately, as you are using a commercial theme, you should ask your theme vendors for more information, if you cannot find the culprit on your own.

    Thread Starter msouthon

    (@msouthon)

    I’m trying to find that snippet of code

    body { font-size: 15px; }

    Would you be able to explain to me which template file it is in?

    Thanks.

    No, because I don’t have access to your theme and there’s no indication of where it came from in the source code of your site. Have you tried temporarily disabling all plugins and checking out your theme’s options?

    Thread Starter msouthon

    (@msouthon)

    I found the problem! As you suggested it was in the ‘Theme Options’. Some time ago I had entered that snippet of css in the ‘Custom CSS’ field of the theme’s ‘Styling Options’. I’ve now removed it and the font-size is responding properly. Thank you so much for your help and your time!

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘cannot change the font-size in my wp theme’ is closed to new replies.