Skip to content

Instantly share code, notes, and snippets.

@merianos
Created October 4, 2017 06:19
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save merianos/da341f38b87bcbbbe2bb1048404748fa to your computer and use it in GitHub Desktop.
Save merianos/da341f38b87bcbbbe2bb1048404748fa to your computer and use it in GitHub Desktop.
Custom font family in the Fonts control of the Elementor page builder after the version 1.7.10
// After the Elementor update to 1.7.10, the fonts list has change in the
// control settings from `fonts` to `options`.
//
// Thus for version after 1.7.10 we should use the following code for retrive
// and set the new font families.
$fonts = $controls_registry->get_control( 'font' )->get_settings( 'options' );
// Register here the custom font families
$controls_registry->get_control( 'font' )->set_settings( 'options', $new_fonts );
@Moultrex
Copy link

Can you write an example of how to register the custom font?

Let's say i have a font.ttf file and upload it to my direcotry.

I put the code in functions.php

Where i register the path to font.ttf on that code?

@adam-acosta
Copy link

adam-acosta commented Feb 8, 2018

FWIW I added my fonts directly in fonts.php and elementor picked it up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment