MaxRussell
MaxRussell

Reputation: 651

Use google font in Wordpress

I'm trying to add a Google font to the Wordpress Cyberchimps responsive theme.

https://cyberchimps.com/forum-topic/where-do-i-override-the-default-font/

I've tried to embed the link to the font in the header, but it doesn't update to use it.

How can I use the custom font?

Upvotes: 0

Views: 171

Answers (1)

Aalind Sharma
Aalind Sharma

Reputation: 423

To use google fonts in your website, you simply need to put a link in the head of your page ( in a similar manner like you add css files ). Like this :-

<link href='https://fonts.googleapis.com/css?family=IM+Fell+DW+Pica' rel='stylesheet' type='text/css'>

And access it in you css like this :-

.im-fell-dw-pica-font{
    font-family: 'IM Fell DW Pica', sans-serif; 
}

Here 'IM Fell DW Pica' is the google font required.( Note that sans-serif is defined after our required font 'IM Fell DW Pica'. This is done so that the browser loads sans-serif font if our google font is not loaded for some reason. )

You can now apply this class to the element you want like this :-

<div class="im-fell-dw-pica-font">Some random text</div>

Upvotes: 1

Related Questions