Design My Website Logo

Add a custom font to Salient WordPress theme

Step 1: Download and Install the Custom Fonts Plugin

Download the Custom Fonts plugin from this link, and install it on your WordPress site.


Step 2: Upload Your Fonts

After installing and activating the plugin:

  1. Go to Custom Fonts settings in your WordPress admin panel.
  2. Upload your font files (e.g., .woff, .woff2, .ttf, etc.).

Step 3: Add the Custom Fonts to Salient Typography

To make your custom fonts appear in Salient’s typography settings, add the following code snippet to your theme’s functions.php file:

phpCopy codefunction salient_redux_custom_fonts() {
    return array(
        'Custom Fonts' => array(
            'Neo Sans Std Regular' => 'Neo Sans Std Regular',
            'Neo Sans Std Bold' => 'Neo Sans Std Bold'
        )
    );
}
add_filter( "redux/salient_redux/field/typography/custom_fonts", "salient_redux_custom_fonts" );

Explanation of the Code

  • Function Name: salient_redux_custom_fonts() defines a list of custom fonts for the Salient theme.
  • Custom Fonts Array:
    • 'Neo Sans Std Regular' => 'Neo Sans Std Regular': This maps the font name so that it appears in the typography settings dropdown in Salient.
    • Add additional fonts as needed by following the same format.
  • Filter Hook: The redux/salient_redux/field/typography/custom_fonts filter connects the custom fonts with Salient’s typography settings.

Final Steps

  1. Go to Salient Theme Options > Typography.
  2. Your custom fonts (e.g., “Neo Sans Std Regular” and “Neo Sans Std Bold”) should now appear in the typography settings dropdown.
  3. Apply them to the desired elements of your website.

That is an easy way to add a custom font to Salient WordPress theme. For more tips go to our blog.

Related articles

Ready to transform your business?

Schedule a free consultation today.

Design My Website are a web design company based in Kerry. The majority of our meetings are done via video call but we can travel within Munster.

Contact Us
  • 083 1985 855
  • tommy@designmywebsite.ie
  • Kilcummin, Killarney, Co Kerry, Ireland
© 2024 Design My Website