Skip to content
Download the Ghost Themes Bundle for only $249 β€” Use BUNDLE code for 10% discount πŸ”₯

How to Change the Fonts of the Casper Ghost CMS Theme Using Google Fonts

In this tutorial, I will show you how to change the fonts of the Casper Ghost CMS theme using Google Fonts.

The Casper theme is using two different fonts:

  • Georgia for the post content and excerpts.
  • UI System Fonts for everything else.

Suppose you want to use the Roboto Google font instead of the theme UI System Fonts.

In your Ghost admin, using Code Injection Site Header section, embed the font code given from Google Fonts as follows.

<link href=';700&display=swap' rel='stylesheet'>

You can choose different font styles depending on your needs. In this example, I choosed the 300 and the 700 weights.

The next step is to assign the Roboto font to the body element using CSS as follows.

  body { font-family: 'Roboto', sans-serif; }

The Code Injection area will look similar to the below screenshot.

Code Inection Site Header section code to Change a Font in Ghost Theme

Change the Font of a Specific Element

If you want to change the font of a specific element, you need to get the class name of that element. You can use the browser development tools to do that.

You can use Chrome DevTools or Firefox Developer Tools. To open the DevTools, right-click on an element on the page and choose Inspect, then the Elements panel will open. Also, you can press Command+Option+C (Mac) or Control+Shift+C (Windows, Linux, Chrome OS) to open the Elements panel.

Google Chrome Dev Tools Inspect

Google Chrome Dev Tools

Then, you can get the element CSS selector class, in our case, the post excerpt class .post-card-excerpt and you can assign the new font to it as follows.

  .post-card-excerpt { font-family: 'Roboto', sans-serif; }

To move around the web page elements or to go to a more specific element class, you can click the Inspect icon to select an element on the page.

Google Chrome Dev Tools Inspect Icon

If you want to set the font size for an element, you can use the CSS font-size property to do that. For example, to set the font family and font size for the previous example, you can do something like the following.

  .post-card-excerpt { font-size: 16px; }

To wrap all the code we have done so far, it could look like the following in Code Injection.

<link href=';700&display=swap' rel='stylesheet'>

  .body { font-family: 'Roboto', sans-serif; }

  .post-card-excerpt {
    font-family: 'Roboto', sans-serif;
    font-size: 16px;

Don’t worry if you didn’t grasp how the CSS code works at first. If you are curious to learn more, I would recommend the Learn web development resource by Mozilla.

Make a Stunning Ghost Website

Beautiful, functional Ghost CMS themes with unparalleled support.

Explore themes β†’
  • Easy Install
  • Free Support & Updates
  • 100% Money-Back Guarantee