StyledThemes

Google Fonts & Optimizing CSS

Home Forums WordPress Themes – Premium Lavish Pro Google Fonts & Optimizing CSS

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #40703
    Diana Cobb
    Participant

    Hello there,

    I am working on improving my website’s speed. According to the Google PageSpeed Tool, I need to optimize CSS Delivery of some Google Fonts (among other things):

    https://fonts.googleapis.com/css?family=Open+Sans%3A400%2C700%2C600&ver=4.6.1
    https://fonts.googleapis.com/css?family=Lato%3A400%2C700%2C900&ver=4.6.1
    https://fonts.googleapis.com/css?family=Parisienne|Titillium+Web

    The problem is, I cannot find where the first 2 fonts are located in my CSS…?? I located the the Parisienne/Titillium+Web in my child theme’s Header file, but I cannot find where the other two are. They are not in the child theme’s Header. I do not use those fonts so I would like to remove them from my css completely. I just can’t find them! Is this something you may be able to assist me with? I’ve been wracking my brain. THANK YOU!

    My website is: premiereroux.com

    -Diana

    #40711
    Sushil Adhikari
    Moderator

    Dear Diana Cobb,

    Those font are rendered using wp_enqueue_scripts hook, you can this on functions.php file under lavish_scripts () function.
    If you want to remove them you you can dequeue[ https://codex.wordpress.org/Function_Reference/wp_dequeue_style ] this handler on child theme functions.php
    You can follow this example:

    function lavish_child_dequeue_scripts() {
        	wp_dequeue_style( 'lavish-open-sans');
        	wp_dequeue_script( 'lavish-lato' );
        }
        add_action( 'wp_enqueue_scripts', 'lavish_child_dequeue_scripts', 100 );

    Note: Please follow this procedure only if you are technically sound on WordPress, otherwise you will get some fatal error.

    Thanks

    #40827
    Diana Cobb
    Participant

    I see. In that case, as I am not ‘technically sound’ on WordPress, I will leave it alone. Do you have any recommendations on how to optimize Google fonts?

    Thanks!! -Diana

    #40828
    Sushil Adhikari
    Moderator

    Dear Diana Cobb,

    Thank you for your response.Might be this plugin may help you on this: https://wordpress.org/plugins/google-webfont-optimizer/

    Thanks

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.