Adding Google font to Essential Grid

Hi,

I’m trying to add a Google Font to Essential Grid. Here’s what I’ve done so far.

Website: https://staging6.upstatefilms.org/x-home

Google font: https://fonts.google.com/selection?query=oswald&selection.family=Oswald:300,400,500,600\

I’ve added this to the customizer’s CSS:

@import url(‘https://fonts.googleapis.com/css?family=Oswald+sans-serif:300,400,600&display=swap’);

I’ve added this to the functions.php in the child theme:

add_action (‘wp_head’, ‘custom_google_font’, 9999 );
function custom_google_font() {
echo ‘’;
}

I’ve added the Oswald font to the Punch Fonts as described here:
https://www.themepunch.com/essgrid-doc/google-fonts/

I can select Oswald in Essential Grid, and it shows up as Oswald sans-serif when I inspect the page, but the font is not Oswald. For example, the titles “Dark Waters” and “Marriage Story” in the Essential Grid box on the top left under the slider is styled as Oswald, but it’s defaulting to something else.

Can you help me figure out what I’m missing?

BTW, I’ve made other changes to the functions.php, so just in case the problem is there, here’s the whole file:

<?php // ============================================================================= // FUNCTIONS.PHP // ----------------------------------------------------------------------------- // Overwrite or add your own custom functions to X in this file. // ============================================================================= // ============================================================================= // TABLE OF CONTENTS // ----------------------------------------------------------------------------- // 01. Enqueue Parent Stylesheet // 02. Additional Functions // ============================================================================= // Enqueue Parent Stylesheet // ============================================================================= add_filter( 'x_enqueue_parent_stylesheet', '__return_true' ); // Additional Functions: Shows buttons for Other Films Playing in Rhinebeck and Switch to Woodstock // ============================================================================= add_filter( 'the_content', 'filter_the_content_in_the_main_loop', 999999999 ); function filter_the_content_in_the_main_loop( $content ) { // Check if we're inside the main loop in a single post page. if ( is_singular('post') && in_the_loop() && is_main_query() ) { if ( in_category( "now-showing" ) ) { return $content . '
Other Films Playing in RhinebeckSwitch to Films Playing in Woodstock
'; } if ( in_category( "now-showing-woodstock" ) ) { return $content . '
Other Films Playing in WoodstockSwitch to Films Playing in Rhinebeck
'; } } return $content; } // Content Views - remove functions which get content from Cornerstone remove_filter( 'the_content', 'cv_comp_plugin_cornerstone_single', PHP_INT_MAX ); remove_filter( 'pt_cv_field_content_excerpt', 'cv_comp_plugin_cornerstone_core', 9, 3 ); remove_filter( 'pt_cv_field_content_full', 'cv_comp_plugin_cornerstone_core', 9, 3 ); add_action ('wp_head', 'custom_google_font', 9999 ); function custom_google_font() { echo ''; }

I don’t think the code I added to the functions.php came through. Let’s try again

add_action (‘wp_head’, ‘custom_google_font’, 9999 );
function custom_google_font() {
echo ‘’;
}

That didn’t work, so here’s a screenshot

Hello Steve,

The code is working correct. The issue is how you use it. See this: https://screencast-o-matic.com/watch/cqlIljveeP

The font defined is Oswald only. How you use it is Oswald san-serif. It should be use as Oswald.

Hope this helps.

That fixed the problem perfectly. Thank you very much. As always, your support is the best.

Hey Steve,

You’re most welcome!
It’s good to know that @Lely were able to help you out.

Cheers.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.