[Resolved] Unable to Remove Google Fonts using the GP PHP

Home Forums Support [Resolved] Unable to Remove Google Fonts using the GP PHP

Home Forums Support Unable to Remove Google Fonts using the GP PHP

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #2320679
    Ken

    I wanted to get rid of all Google Fonts, including in the Customizer. I used the following php code from GP Knowledgebase in my PG Child PHP and I got the following mess, please see screenshot.

    Here are the two codes I used:

    add_action( 'wp_enqueue_scripts', function() {
        wp_dequeue_style( 'generate-fonts' );
    } );
    add_action( 'admin_init', function() {
        add_filter( 'generate_google_fonts_array', '__return_empty_array' );
    } );

    Please see attached screenshot of result.
    I’m going to delete the code now. Hope that’s okay.
    Thank you for your time and help.
    Ken

    #2320685
    Fernando
    Customer Support

    Hi Ken,

    May we know how you added the code?

    #2320688
    Ken

    I added to the GP Child FUNCTIONS PHP file on top.

    Screenshot link: https://share.getcloudapp.com/lludRp6X

    Please note, I have deleted the code because it messed up my site.
    Hope this helps. Thank you.

    #2320690
    Fernando
    Customer Support

    Do you have a staging site? Can you try re-adding the code at the bottom?

    #2320692
    Ken

    You mean below the following:
    <?php
    /**
    * GeneratePress child theme functions and definitions.
    *
    * Add your custom PHP in this file.
    * Only edit this file if you have direct access to it on your server (to fix errors if they happen).
    */

    I should add the code here???
    I’ll give it a try.

    #2320697
    Ken

    Woo! Hoo! Fernando, That worked! I added the code ‘below’ the text and all is good. I checked the Typography and there are no Google Fonts.
    Problem Solved ٩(^ᴗ^)۶
    I’ll close this ticket with a smile.

    But before I go… I think it would have been nice to add a sentence to that Child Functions PHP saying, “Please add code below this text message” That would have prevented this confusion. Just a suggestion. A little info never hurts.

    Thanks again for your help.

    #2320707
    Fernando
    Customer Support

    You’re welcome Ken! I’ll recommend it to the team.

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