I would not add <link href=’https://fonts.googleapis.com/css?family=Ubuntu’ rel=’stylesheet’ type=’text/css’> to header.php. Like the moderator said when/if you upgrade the theme the external link to googles CSS file is lost.
I have been working on a similar project (to help me understand how the wordpress hierarchy works).
The best way to add the google link to the header of the WordPress DOM is to create a functions.php file in the child theme, and add php code to make it more dynamic.
function load_google_fonts() {
wp_register_style('googleFontsUbuntu','https://fonts.googleapis.com/css?family= Ubuntu');
wp_enqueue_style( 'googleFontsUbuntu');
}
add_action('wp_print_styles', 'load_google_fonts');
So to help me process this in my head, within a separate functions.php in the child theme (not the main theme) a function is written registering the font and then it is enqueued. Finally you add the action to print out the fonts.
For the record I know there is a Google fonts plugin I could use, but I want to figure this way out for learning purposes…
Where I am is now I can see the twenty twelve-child css links in the header when I view the source- so I know my google fonts are loaded and ready to be used, but I cannot get the right css properties to override the Open Sans, Helvetica… font-family.
I have found the main font-family properties in the main theme’s style.css, so I just override them by specifying them within the styles.css in the -child folder:
@import url(../twentytwelve/style.css);
body {
font-family: Marck+Script, Roboto, Averia+Libre, sans-serif;
}
body.custom-font-enabled {
font-family: Marck+Script, Roboto, Averia+Libre, sans-serif;
}
.entry-content code,
.comment-content code {
font-family: Marck+Script, Roboto, Averia+Libre, sans-serif;
}
.entry-content pre,
.comment-content pre {
font-family: Marck+Script, Roboto, Averia+Libre, sans-serif;
}
body,
input,
textarea,
.page-title span,
.pingback a.url {
font-family: Marck+Script, Roboto, Averia+Libre, sans-serif;
}
Nothing changes. I am lost, anybody have a suggestion? Thank you ??