How to change fonts?


#1

Hi everyone.
I am using this method to change fonts:
I uploaded my web font kit into my child theme fold, then I put this code at the end of the functions.php:

function add_custom_font() {  
    $url = 'http://www.iltergiversatore.com/wp-content/themes/rtpanel-child/fonts/webfontkit/stylesheet.css';  
    wp_register_style('merriweather_sansregular', $url);  
    wp_enqueue_style('merriweather_sansregular');  
$url = 'http://www.iltergiversatore.com/wp-content/themes/rtpanel-child/fonts/webfontkit/stylesheet.css';  
    wp_register_style('merriweatherregular', $url);  
    wp_enqueue_style('merriweatherregular');  
$url = 'http://www.iltergiversatore.com/wp-content/themes/rtpanel-child/fonts/webfontkit/stylesheet.css';  
    wp_register_style('bebasregular', $url);  
    wp_enqueue_style('bebasregular');  
}

But when I try to change font in style.css nothing happens. Am I wrong or do I have to pick another way?


#2

Hello tergiversatore,
Add following line after the function you given above.

add_action( ‘wp_enqueue_scripts’, ‘add_custom_font’, 18 );

Let me know if this works for you.

Thanks


#3

Thank you so much, it worked perfectly! Big up, guys!


#4

Glad to know that it works for you. :slight_smile:


#5