Skip to content
MIGHTYminnow Logo
  • Our Work
  • Our Services
  • Our Story
  • Our Work
  • Our Services
  • Our Story
Contact Us
betterdocs-category-icon

Design

1
  • Processing Images in Photoshop (Action)
betterdocs-category-icon

FontAwesome

1
  • Fix missing content after copy environment
betterdocs-category-icon

Hosting

16
  • Shopify
    • Shopify
  • Squarespace
    • Create Automatically Rotating Testimonials
    • Underline active menu navigation item
  • WP Engine
    • Fix missing content after copy environment
    • Fix the “Copy site failed” error in WP Engine
    • How to fix the “Can’t copy file” error when uploading a plugin
    • Images missing custom size on legacy staging
    • Migrate an Elementor site using WPE Migration Tools
    • Redirections
    • Reset Password Link not working with Ultimate Member plugin
    • Reset Password Links Known Issues
    • WP Engine PDF Redirects + Exclude PDFs from search engines
    • WPEngine
    • NGINX Snippets
      • Force PDF download
      • No-index PDFs
      • WP Engine PDF Redirects + Exclude PDFs from search engines
betterdocs-category-icon

MIGHTYminnow Approches

16
  • Accessibility Tools
  • DNS Tools
  • Font Awesome icons not showing
  • Hash link scroll with sticky header
  • How-tos
  • HTML in Ninja Tables
  • Launch / DNS Checklists
  • Mm Resources
  • WP Engine PDF Redirects + Exclude PDFs from search engines
  • Maintenance
    • Copying from Legacy Staging to Live
    • Did Google not return as many pages as you thought it should?
    • Did the HTTPS check reveal pages that failed?
    • Did you find a Too Many Redirects error?
    • Did you generate a 404 on Staging?
    • Fix missing content after copy environment
    • Media Cleaner Pro – step by step process for production
betterdocs-category-icon

WP Plugins Tutorials

25
  • Media Cleaner Pro – step by step process for production
  • Elementor
    • Creating a Category Navigation Dropdown in Elementor
    • Display Custom Post Types in Elementor
    • Duplicated navigation submenu arrows
    • Elementor Archive Posts Widget Pagination Tip
    • Elementor Cache
    • Elementor PRO + Hello Theme (Initial Setup) + Production Tips
    • Elementor: Different Mastheads for Each Device Size the Unconfusing Way
    • Fix missing content after copy environment
    • Fixed cover hero
    • Frozen dropdown menus
    • Migrate an Elementor site using WPE Migration Tools
    • Missing “Edit with Elementor” on the Front End
    • Missing Icons (squares showing instead)
    • Sticky Transparent Header in Elementor Pro
    • Transparent header in Astra using Elementor Pro
    • Transparent Header in Elementor Pro
  • Gravity Forms
    • Capturing Post Data With Gravity Forms
    • Reset Password Links Known Issues
  • Media Cleaner Pro
    • Media Cleaner Pro – step by step process for production
  • Toolset
    • Creating a Filterable Output with Toolset Types and Views
  • Ultimate
    • Reset Password Links Known Issues
  • Ultimate Member
    • Reset Password Link not working with Ultimate Member plugin
    • Reset Password Links Known Issues
  • WPML
    • Fix missing content after copy environment
betterdocs-category-icon

WP Themes

7
  • Astra
    • Duplicated navigation submenu arrows
    • Frozen dropdown menus
    • Transparent header in Astra using Elementor Pro
  • Hello
    • Elementor PRO + Hello Theme (Initial Setup) + Production Tips
  • Jupiter
    • Add missing underline to links in Classic editor.
    • Jupiter Theme Update Process
    • Page Builder Modified Version (Jupiter) and Permissions with Multiple Roles
View Categories
  • Home
  • Docs
  • How to add custom fonts to LearnDash LMS Certificates without losing them after plugin updates

How to add custom fonts to LearnDash LMS Certificates without losing them after plugin updates

Table of Contents
  • 1) Upload your .TTF file
  • 2) Add code to functions.php
  • 3) Using the fonts on your certificates

Recently, we had to add some Google Fonts to a LearnDash Certificate and we found a great article on Discover eLearning: how to add custom fonts to your LearnDash LMS certificates But this method has two needed improvements:

  1. Once you update the LearnDash LMS plugin, your fonts will be gone and you will need to add them manually again.
  2. You need to use an external tool to convert your .ttf file

So we delved into the source code of LearnDash and found that there is a hook to make it work without losing the changes when the plugin is updated.

1) Upload your .TTF file #

Create a subdirectory named fonts on your theme (or child theme) and upload your .ttf file(s) on it.

On this example, we will download the following fonts:

  • Alex Brush: https://fonts.google.com/specimen/Alex+Brush?query=alex+brush
  • Open Sans: https://fonts.google.com/specimen/Open+Sans?query=open+sans

When you download a font from Google Fonts, you will get a lot of .ttf files for some fonts. On this case, Alex Brush only contains 1 .ttf file because it has no variations. But Open Sans contains 38 .ttf files (if you didn’t filter the styles before downloading), for this example, we will use only the normal and bold versions. So, the list of files we will upload are:

  • AlexBrush-Regular.ttf
  • OpenSans-Bold.ttf
  • OpenSans-Regular.ttf

2) Add code to functions.php #

Now, you will add the following code to your functions.php:

You may want to edit this code to match the fonts of your preference, but please pay attention to the following details:

  1. On the file_exists conditional, your font name must be all lowercase, without spaces or dashes and followed by .php
  2. We will add each of our .ttf files using TCPDF_FONTS::addTTFfont Note that on this case, the filename must match the filename of the .ttf files, including uppercases, dashes, etc. And that it includes the /fonts/ subdirectory we created.

What this code does is to generate the same files that you would have generated with the external tool but using the TCPDF library that is already included in LearnDash. This way you don’t depend on external tools.

It also checks if those files already exist, this way they are not generated every time the site is loaded. But they are only generated the first time and after every plugin update (because they will be removed with the update). So, you don’t need to worry to manually add them every time.

3) Using the fonts on your certificates #

You are ready to start using the fonts on your certificates as you would normally do using inline CSS, for example:

But there are 2 important things to note:

  1. The font-family needs to have the same format that we previously used in the file_exists conditional, for example: opensans instead of Open Sans.
  2. You cannot use font-weight: 700 to make a font bold, you only can use the “bold” keyword ( font-weight: bold).
What are your Feelings

Share This Article :

  • Facebook
  • X
  • LinkedIn
  • Pinterest
Still stuck? How can we help?

How can we help?

Updated on May 19, 2024

Powered by BetterDocs

Get in Touch

We would love to learn about your project, offer you a free quote and share our project planning tips and resources. 

Contact Us

Or call us : 510 629 1440

Facebook-f Twitter Instagram Youtube Yelp
Newsletter Sign Up

Blog | Sitemap | Privacy Policy | Cookie Policy | Terms of Service | Disclaimer
Copyright © 2026 MIGHTYminnow Web Design & Development

Newsletter

Subscribe and stay connected through our Newsletter. We send out important news, tips and special offers.

"*" indicates required fields

This field is for validation purposes and should be left unchanged.

MIGHTYminnow