• Resolved fafanellu

    (@fafanellu)


    Hi !

    I’m experiencing some troubleshooting when I use the Roboto font on my website.

    Actually, even if I specified in my CSS file that I want <h1> titles to be written in Roboto Thin 100, my text displayed on my final website in a larger variant (probably “Normal 400”). But it displays perfectly in the WYSIWYG WordPress Page Edition window ! Weird, isnt’it ?

    I use Customizr theme with a child theme. Here is the part of my redefined functions.php file (where I declare the Roboto family) :

    /*Here I declare my Google font family Roboto*/
    add_action( 'wp_enqueue_scripts', 'my_google_font' );
    function my_google_font() {
    wp_enqueue_style( $handle = 'my-google-font', $src = 'https://fonts.googleapis.com/css?family=Roboto', $deps = array(), $ver = null, $media = null );
    }

    Here are now some parts of my .css code :

    /* I want Roboto to be used in my <body> */
    body {
    font-family: 'Roboto', sans-serif;
    color: #565C66;
    font-size: 14px;
    }
    /* My H1 title */
    h1 {
    font-size: 40px;
    color: #565C66;
    font-style : thin;
    font-weight: 100;
    }

    So, what’s wrong with my code ? Any kind of help would be appreciated !

    Many thanks

Viewing 1 replies (of 1 total)
  • Thread Starter fafanellu

    (@fafanellu)

    Solved !

    I just modified the functions.php so that it can handle all the Roboto font styles ant weights

    add_action( 'wp_enqueue_scripts', 'my_google_font' );
    function my_google_font() {
    wp_enqueue_style( $handle = 'my-google-font', $src = 'https://fonts.googleapis.com/css?family=Roboto:400,100,100italic,300,300italic,400italic,500,900italic,900,700italic,700,500italic', $deps = array(), $ver = null, $media = null );
    }
Viewing 1 replies (of 1 total)
  • The topic ‘[Theme: Customizr] Display problem with Roboto font family’ is closed to new replies.