Community Forums › Forums › Archived Forums › Design Tips and Tricks › Google Fonts not showing?
Tagged: css, google fonts, php
- This topic has 4 replies, 2 voices, and was last updated 11 years, 8 months ago by
newedgemarketing.
-
AuthorPosts
-
February 24, 2015 at 11:50 pm #142156
newedgemarketing
MemberI've just changed the enqueue code my functions.php file as i want to replace the font used by default in my theme currently oswald to open sans condensed.
I've added this:
I then went int my style sheet and replaced all instances of oswald with open sans condensed
But nothing changed.
I've cleared my cache I am running w3-cache and have a supercache on my host provider which i've flushed and turned off for now.
Anyone know what i'm doing wrong???
this is what I've added:
//* Enqueue Google fonts
add_action( 'wp_enqueue_scripts', nem_load_google_fonts );
function nem_load_google_fonts() {
wp_enqueue_style( 'nem-googlefonts', '//fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,400,300|Open+Sans+Condensed:700', array(), CHILD_THEME_VERSION );
}So my style sheet currently reads as follows:
//* Enqueue scripts and styles
add_action( 'wp_enqueue_scripts', 'eleven40_enqueue_scripts_styles' );
function eleven40_enqueue_scripts_styles() {wp_enqueue_script( 'eleven40-responsive-menu', get_bloginfo( 'stylesheet_directory' ) . '/js/responsive-menu.js', array( 'jquery' ), '1.0.0' );
wp_enqueue_style( 'dashicons' );
wp_enqueue_style( 'google-fonts', '//fonts.googleapis.com/css?family=Lora:400,700|Oswald:400', array(), PARENT_THEME_VERSION );}
//* Enqueue Google fonts
http://www.newedgemarketing.com.au/
add_action( 'wp_enqueue_scripts', nem_load_google_fonts );
function nem_load_google_fonts() {
wp_enqueue_style( 'nem-googlefonts', '//fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,400,300|Open+Sans+Condensed:700', array(), CHILD_THEME_VERSION );
}February 25, 2015 at 6:08 am #142182Victor Font
ModeratorIt looks like you may have figured out your issue. Your fonts are loading on your site even though you have an error in your code above. Your function name needs to be wrapped in quotes.
add_action( 'wp_enqueue_scripts', 'nem_load_google_fonts' );
Regards,
Victor
https://victorfont.com/
Call us toll free: 844-VIC-FONT (842-3668)
Have you requested your free website audit yet?February 25, 2015 at 6:26 am #142186newedgemarketing
MemberHi victor it's not fixed at all I'm still seeing Oswald it should be open San condensed on the menu, headings etc
February 25, 2015 at 6:59 pm #142300Victor Font
ModeratorWhen I look at the CSS in the inspector tools, it is showing the Open Sans as the active font.
Regards,
Victor
https://victorfont.com/
Call us toll free: 844-VIC-FONT (842-3668)
Have you requested your free website audit yet?February 26, 2015 at 2:37 am #142341newedgemarketing
MemberI don;t know what to say I've cleared my cache in my browser, host etc when i use inspect element or firebug it shows oswald but there's no instance of oswald anymore in my style sheet
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.