• Resolved Zarminsky

    (@zarminsky)


    Moin,

    I updated baskerville (Version 1.30) and now the google-fonts roboto and pacifico are not available anymore.
    In the readme-file I find: »Added option to disable Google Fonts with a translateable string« (Version 1.27).
    I cannot find this option in the customiser. Do I have to look somewhere else?

    Best regards
    Armin

Viewing 8 replies - 1 through 8 (of 8 total)
  • Theme Author Anders Norén

    (@anlino)

    Hi @zarminsky,

    Can you post a link to your site?

    The translateable string that can disable Google Fonts is set to false by default (= Google Fonts is active by default), so that shouldn’t be causing the issue.

    — Anders

    Thread Starter Zarminsky

    (@zarminsky)

    Hi Anders,

    The following is one of the sites, where I use Baskerville (and a childtheme with some modifications):
    https://simply-coaching.de/

    Best regards
    Armin

    Theme Author Anders Norén

    (@anlino)

    Hi @zarminsky,

    Depending on how you’re child theme stylesheet enqueue function is structured, you need to check that the “baskerville_googleFonts” stylesheet is enqueued.

    The Baskerville enqueue structure changed in version 1.20. You can find a thread about that here: https://wordpress.org/support/topic/v1-20-wont-load-child-theme-css/

    — Anders

    • This reply was modified 5 years, 10 months ago by Anders Norén.
    Thread Starter Zarminsky

    (@zarminsky)

    Hej Anders,

    Thank you: I’ll try again. My way to enque the styles is the following:

    function my_theme_enqueue_styles() {
     
        $parent_style = 'baskerville_style';
     
        wp_enqueue_style( $parent_style, get_template_directory_uri() . '/style.css' );
        wp_enqueue_style( 'baskerville-claudia-style',
            get_stylesheet_directory_uri() . '/style.css',
            array( $parent_style ),
            wp_get_theme()->get('Version')
        );
    	
    }
    add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles' );

    But anyhow: Even when I activate the original theme baskerville, I cannot find the option concerning google fonts. Where do I have to look for it?

    With best regards
    Armin

    Theme Author Anders Norén

    (@anlino)

    Hi @zarminsky,

    Replace that code block with the following:

    function my_theme_enqueue_styles() {
     
     	wp_register_style( 'baskerville_googleFonts', '//fonts.googleapis.com/css?family=Roboto+Slab:400,700|Roboto:400,400italic,700,700italic,300|Pacifico:400', false, 1.0, 'all' );
        wp_register_style( 'baskerville_style', get_template_directory_uri() . '/style.css' );
    
        wp_enqueue_style( 'baskerville-claudia-style', get_stylesheet_uri(), array( 'baskerville_googleFonts', 'baskerville_style' ), wp_get_theme()->get('Version') );
    	
    }
    add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles' );

    That should load the fonts CSS correctly.

    — Anders

    Thread Starter Zarminsky

    (@zarminsky)

    Hej Anders,

    thank you very much, with this code everything works fine.

    Best regards
    Armin

    Hello, I have a similar issue.
    We need to disable the direct use of GOOGLE fonts due to DSGVO un-conformity.

    Looking on function.php, there is a variable “$google-fonts” where I can disable the use of google fonts in this theme. But I do not find any input/config filed inthe customizer of the theme.

    Could you give a short advise, how and where to set this variable?
    Of course, I could remove the code block from the function.php, but I do no want to change anything in the original function.phpp of this theme to keep update path alive.

    Thx

    Jens

    Hi Jens,

    the variable is intended to be set to “off” by translators (!), if there there are characters in the translated language which are not available in the theme fonts.
    See functions.php, comment in lines 95-98.
    One can do so at translate.wordpress.org – for example here (for de_DE): https://translate.wordpress.org/projects/wp-themes/baskerville/de/default/?filters%5Bterm%5D=google&filters%5Buser_login%5D=&filters%5Bstatus%5D=current_or_waiting_or_fuzzy_or_untranslated&filter=Filter&sort%5Bby%5D=priority&sort%5Bhow%5D=desc

    This translation applies to all users who use this specific language (pack). So it’s not the way to go for you 🙂

    If you want to set Google Fonts to “off” for your own project, you should use a child theme and host the needed fonts yourself. It’s not that hard:
    https://wp-ninjas.de/wordpress-google-fonts

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Where do I find Google Fonts Option’ is closed to new replies.