Site logo

Archived topic

Local Fonts and ttf

18 replies · Started by Paul on March 8, 2020

Viewing posts 16–19 of 19

You need to make sure you use the full URL to the file.

If Open Sans is rendering as Helvetica, it means something is wrong with the font file/@font-face declaration.

Hi Tom, you are again quite correct. Embarassing this - but the name of the folder inside /fonts was missing. I have added the final folder name of the path to the url and all is well.
Just need to work out how to make the test page pick up the styles from style_test.css
Thank you for your persistence and patience, Paul

This code has worked well to introduce the second stylesheet style_test.css

/* add link to stylesheet to the head section */
add_action( 'wp_enqueue_scripts', function() {
		$child_folder = trailingslashit( get_stylesheet_directory_uri() );
		wp_enqueue_style( 'style', $child_folder . 'style_test.css' );
	} );

If I may I will start another topic as I am not sure how to make this only load for one page
thank you, Paul

Glad you got it working! :)

This archived topic is closed to new replies.