Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1362271
    Kawika
    Participant

    Hi,

    I would like to use multiple font-weights for headings. Currently we are using Raleway (Google), and in customizer the font weight is set to 600.

    I read an archived thread regarding this (https://community.theme.co/forums/topic/font-weight-2/) and added the following (see below) to our child functions.php but it’s not working.

    // Remove and replace Raleway font
    // =============================================================================
    
    function x_remove_replace_raleway_font(){
      wp_dequeue_style( 'x-font-standard' );
      wp_enqueue_style( 'raleway-font', '//fonts.googleapis.com/css?family=raleway:100,300,400,700,900,100italic,300italic,400italic,700italic,900italic', NULL, X_VERSION, 'all' );
    }
    add_action( 'wp_enqueue_scripts', 'x_remove_replace_raleway_font', 100 );
    
    // =============================================================================
    #1362275
    Kawika
    Participant
    This reply has been marked as private.
    #1362459
    Friech
    Moderator

    Hi There,

    Thanks for writing in! Please add this on top of your child theme’s style.css file.

    @import url('https://fonts.googleapis.com/css?family=Raleway:300,300i,400');

    Hope it helps, Cheers!

    #1363444
    Kawika
    Participant

    Hi,

    Thank you for your quick reply. Unfortunately adding the above css to my style.css file did not work. Is the code I added to my child’s functions.php correct?

    Thanks,
    Kawika

    #1363822
    Friech
    Moderator
    This reply has been marked as private.
    #1365003
    Kawika
    Participant

    Hi,

    I decided to go with the functions.php route because we are still in design/dev phase and might want to explore other weights. It wasn’t working before because of a small typo in the URL (Aaah so frustrating). Anyway, your comment above regarding the correct URL let me relook at the code and I found my mistake.

    Correct URL:
    fonts.googleapis.com/css?family=Raleway:300,400,600,800

    In correct URL:
    fonts.googleapis.com/css?family=raleway:100,300,400,800

    For anyone else looking to do this here’s what I added to our child themes functions.php file

    // Remove and replace Raleway font
    // =============================================================================
    
    function x_remove_replace_raleway_font(){
      wp_dequeue_style( 'x-font-standard' );
      wp_enqueue_style( 'raleway-font', '//fonts.googleapis.com/css?family=Raleway:300,400,600,800', NULL, X_VERSION, 'all' );
    }
    add_action( 'wp_enqueue_scripts', 'x_remove_replace_raleway_font', 600 );
    
    // =============================================================================

    Thanks for your help!!!

    #1365248
    Nico
    Moderator

    Thanks for sharing us the fix. It would really help us and the other members of this community.

    Feel free to ask us again.

    Thanks.

  • <script> jQuery(function($){ $("#no-reply-1362271 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>