WP Residence Help WP Residence Help

  • WPRESIDENCE
  • Video Tutorials
  • Client Support
  • API
Home / Technical how to | Custom Code Required / How to add a new Google font

How to add a new Google font

3465 views 0

The easiest way to add google fonts is by using WP Google Fonts plugin: https://wordpress.org/plugins/wp-google-fonts/ 

In a child theme functions.php add the following code


add_action('wp_enqueue_scripts', 'wpestate_scripts_childtheme');
function wpestate_scripts_childtheme() {
$protocol = is_ssl() ? 'https' : 'http';
wp_enqueue_style( 'wpestate-railway', "$protocol://fonts.googleapis.com/css?family=Raleway:500,600,400,700,800&subset=latin,latin-ext" );
}

Now, you need to replace the raleway font in the above example with your font. Open the google fonts page and click quick use for your font. You should have something like in the image below

googlefints

Select the font styles from the list like bold, semi-bold etc. In “Add this code to your site ” section copy the string after  ?family= and replace it in the function above.

Technical how to | Custom Code Required

Related Articles

  • Technical: Change the Schedule Tour Email Text and the Form Default Message
  • Property list filter customization
  • Technical – How to Change the Minimum Image Dimensions for Property Uploads in WPResidence
  • Introduction to WPResidence Header Customization

Help Categories

  • 18Agent, Agency & Developers
  • 5Blog Posts & Blog Lists
  • 38Elementor Shortcodes Built-In
  • 45FAQ
  • 15Footer
  • 5Getting Started
  • 37Header
  • 2IDX & MLSImport
  • 6Installation & Setup
  • 23Installation FAQ
  • 23Maps & Location Settings
  • 21Multi-Language Third Party Plugins
  • 6Other Third party Plugins
  • 19Pages
  • 4Payments & Monetization
  • 20Property Lists, Categories & Archive
  • 36Property Pages & Layouts
  • 31Search & Filtering
  • 162Technical how to | Custom Code Required
  • 8Technical: Actions and filters
  • 6Technical: Child Theme
  • 86Theme Options & Global Settings
  • 6Translations & Languages
  • 16WPBakery Shortcodes
  • 51WPResidence / WPEstate CRM
  • 50WPResidence 5.0 Documentation
  • 8WPResidence Elementor Studio
  • 50WPResidence Translate Plugin

Join Us On

Powered by WP Estate - All Rights Reserved
  • WPRESIDENCE
  • Video Tutorials
  • Client Support
  • API