• Resolved samrods

    (@samrods)


    Hi, everyone.

    I have a question.
    I created a child theme and I defined different types of letter for the menu, bottom of page, etc (the non-serif ones). But the theme downloads two fonts from google: “quicksand” and “playfair display”. The one I am NOT using is Quicksand.

    My question is: how do I prevent quicksand font from being downloaded from google? Using only files in the chil theme. I don’t want to edit function.php.

    Because it is a waste of time in page load, since i am not using it (and it is not showing properly, either, a problem that was reported by other users).

    For those who have the same trouble with quicksand font, here is the font stack I did, to replace “Quicksand, Helvetica, Arial, sans-serif;” i did this:

    font-family: Optima, Candara, "Nimbus Sans", "Trebuchet MS", sans-serif ;

    Thanks in advance for helping.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Look at the “spun_google_fonts” function in the functions.php file of Spun: http://themes.svn.wordpress.org/spun/2.0.2/functions.php

    It enqueues the font files, therefore you can dequeue them in your (Child Theme) functions.php file: http://codex.wordpress.org/Function_Reference/wp_dequeue_style

    Thread Starter samrods

    (@samrods)

    Thank you for sucj«h a short answer, Andrew.
    just let me know if i can get it right, since this is the kind of thing i can’t really test, I think.

    This is the code for the font quicksand in functions.php:

    wp_register_style(
    		'spun-quicksand',
    		"$protocol://fonts.googleapis.com/css?family=Quicksand:300",
    		array(),
    		'20121005'
    	);

    And this is the instruction from the site you gave me:

    <?php wp_dequeue_style( $handle ) ?>

    So, I should do like this in my styles.css:
    <?php wp_dequeue_style( $$protocol://fonts.googleapis.com/css?family=Quicksand:300 ) ?>

    Or something else?

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    The ‘$handle‘ is the first parameter in the ‘wp_register_style‘ function: http://codex.wordpress.org/Function_Reference/wp_register_style

    Therefore the handle you should use is ‘spun-quicksand‘:

    wp_dequeue_style( 'spun-quicksand' );

    Thread Starter samrods

    (@samrods)

    Thank you very much, Andrew.
    I have something more to ask you, because of the link to spun 2.0.2 but it will be in another post.

    Cheers

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Phew luckily the font stuff was the same in the Spun version 1.0.7 functions.php file as the 2.0.2, so that didn’t lead you on a goose chase or break your site.

    But there are other noticeable differences so be aware of this: http://www.diffchecker.com/6dg1cffm (v.1.0.7 on the left | v.2.0.2 on the right).

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Alternative type for the site’ is closed to new replies.