[Support request] automatic font changing problem

Home Forums Support automatic font changing problem

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #1051007
    webkingpro

    i have added custom fonts using this method i added robato and open sans ,but when i save it ,and refresh i can see the same google fonts automaticlaly selected :/

    ex: i selected that local robato and open sans font but its automatically changed to google fonts

    i wannt to add that fonts from my local server.

    thanks
    ML

    #1051008
    webkingpro

    I ADDED local fonts using above methd

    #1051388
    David
    Staff
    Customer Support

    Hi there,

    if you followed this article:
    https://docs.generatepress.com/article/adding-local-fonts/

    Then the fonts you installed locally should be listed separately from the Google font list. If make sure that only your local fonts are chosen within the Customzier then only those will load.

    If you need to you can remove Google Fonts altogether:

    https://docs.generatepress.com/article/remove-google-fonts/

    #1051640
    webkingpro

    I cant save that both code, I tried 1 code per one snippet

    add_action( ‘wp_enqueue_scripts’,’tu_remove_google_fonts’, 10 );
    function tu_remove_google_fonts() {
    wp_dequeue_style( ‘generate-fonts’ );
    }

    add_action( ‘admin_init’, ‘tu_remove_google_fonts’ );
    function tu_remove_google_fonts() {
    add_filter( ‘generate_google_fonts_array’, ‘__return_false’ );
    }

    I can only save one code, I wanna remove google fonts loading + from that customizer list, could you please give me one code for that?

    #1051644
    David
    Staff
    Customer Support

    If you want to use both snippets then the function names need to be different so for the second code use this:

    add_action( 'admin_init', 'tu_remove_google_fonts_customizer' );
    function tu_remove_google_fonts_customizer() {
        add_filter( 'generate_google_fonts_array', '__return_false' );
    }
    #1051645
    webkingpro

    BUT STILL, the google fonts showing on the list on customizer

    #1051833
    David
    Staff
    Customer Support

    Thats odd where are you adding the snippet?
    Looks like you’re site is getting the fonts locally which is good.

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