Skip to content

Instantly share code, notes, and snippets.

@MAXHEADR0OM
Created September 17, 2018 18:56
Show Gist options
  • Save MAXHEADR0OM/0e2f3c69a61a38ae99dd8e75e063c828 to your computer and use it in GitHub Desktop.
Save MAXHEADR0OM/0e2f3c69a61a38ae99dd8e75e063c828 to your computer and use it in GitHub Desktop.
Add Custom Fonts to Divi
/* Add this code to your style.css sheet*/
@font-face {
font-family: Muli-Regular;
src: url(https://www.examplewebsite.com/wp-content/themes/your-child-theme/fonts/Muli-Regular.ttf);
}
/* Upload your preferred font into a new folder called fonts via ftp in the directory /wp-content/themes/YOUR-THEME */
/* Once you do this, you can control global fonts by adding code like below. */
h1 {
font-family: YOUR FONT, Arial, sans-serif;
font-size: 48px;
color: #464646;
}
h2 {
font-family: YOUR FONT, Arial, sans-serif;
font-size: 24px;
color: #464646;
}
p {
font-family: YOUR FONT, Arial, sans-serif;
font-size: 16px;
color: #d7d7d7;
}
/* Alternatively, you can add your custom font in any of the text modules in the divi builder and control it from there */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment