I have this code straight out of one of default themes to load two Google fonts, except I changed the function name. The fonts are not loading, sans serif font shows instead. How do I troubleshoot this?
//add Google fonts
add_action( 'wp_enqueue_scripts', 'sg_add_google_fonts' );
function sg_add_google_fonts() {
$query_args = array(
'family' => 'Dosis:400,600,700|Roboto:400,400italic,700,700italic'
);
wp_register_style(
'google-fonts',
add_query_arg( $query_args, '//fonts.googleapis.com/css' ),
array(),
null
);
wp_enqueue_style( 'google-fonts' );
}
in style.css
h1, h2, h3, h4, h5, h6 {
font-family: 'Dosis', sans-serif;
font-weight:700;
font-size: 32px;
color: #3c3c3c;
}
body {
font-family: 'Roboto', sans-serif;
font-weight:400;
font-size: 24px;
color: #3c3c3c;
}
I actually never was able to enqueue anything in WP - scripts, style sheets, nothing, and ended up hardcoding URLs in the header. I would like to find out a general method how to find out what's not working while using enqueue. Is there some kind of an error message I can have output?
Thank you!
wp_head()
within thehead
tag? Have you looked at the page source to verify if the style and script tags are there or not?