Community Forums › Forums › Archived Forums › Design Tips and Tricks › Cant get font body to be different to Title body in Metro
Tagged: google fonts metro
- This topic has 12 replies, 2 voices, and was last updated 10 years, 7 months ago by Sridhar Katakam.
-
AuthorPosts
-
August 29, 2013 at 2:37 pm #59595psikonMember
Hi,
I am using Google fonts.
I want all headings to be Oswald and all body text to be Lora. I'm pretty sure the below is what I need to change but where?
Any help would be much appreciated./* 02b - Font Family ----------- */
h1,
h2,
h3,
h4,
h5,
h6,
body,
input,
textarea,
.entry-title a {
font-family: Oswald, Georgia, Serif;
}.widgettitle,
#comments h3,
#respond h3,
#title {
font-family: Lora, Georgia, Serif;
}August 29, 2013 at 11:34 pm #59650Sridhar KatakamParticipant1) In style.css, navigate to:
/* 05 Headings ---------------------------------------------------------------------------------------------------- */
There you will find
h1, h2, h3, h4, h5, h6, .entry-title a { line-height: 1.2; margin-bottom: 16px; margin-bottom: 1rem; }
Change it to
h1, h2, h3, h4, h5, h6, .entry-title a { line-height: 1.2; margin-bottom: 16px; margin-bottom: 1rem; font-family: 'Oswald', sans-serif; }
2) In functions.php, change
// Load Oswald Google font add_action( 'wp_enqueue_scripts', 'metro_load_google_font' ); function metro_load_google_font() { wp_enqueue_style( 'google-font', 'http://fonts.googleapis.com/css?family=Oswald:400', array(), PARENT_THEME_VERSION ); }
to
// Load Oswald and Lora Google fonts add_action( 'wp_enqueue_scripts', 'metro_load_google_font' ); function metro_load_google_font() { wp_enqueue_style( 'google-font', 'http://fonts.googleapis.com/css?family=Oswald:400', array(), PARENT_THEME_VERSION ); wp_enqueue_style( 'google-font-2', 'http://fonts.googleapis.com/css?family=Lora', array(), PARENT_THEME_VERSION ); }
and then in style.css, change
/* 02b - Font Family ----------- */ h1, h2, h3, h4, h5, h6, body, input, textarea, .entry-title a { font-family: Helvetica, Arial, sans-serif; }
to
/* 02b - Font Family ----------- */ h1, h2, h3, h4, h5, h6, body, input, textarea, .entry-title a { font-family: 'Lora', serif; }
August 30, 2013 at 7:05 am #59680psikonMemberHi Sridhar,
Thanks for your help but when i copy paste that code into functions.php I get a syntax error? Could there be a character missing possibly?
August 30, 2013 at 8:04 am #59689Sridhar KatakamParticipantCan you paste the error msg?
Also paste the code present in child theme's functions.php at http://www.pastebin.com and give us a link.
August 30, 2013 at 12:02 pm #59717psikonMemberThanks again for your help with this:
This is the error:
( ! ) Parse error: syntax error, unexpected 'google' (T_STRING) in functions.php on line 21
Call Stack
# Time Memory Function Location
1 0.0007 340264 {main}( ) ..\theme-editor.php:0
2 0.0011 408016 require_once( 'D:\wamp\www\admin.php' ) ..\theme-editor.php:10
3 0.0013 426128 require_once( 'D:\wamp\www\wp-load.php' ) ..\admin.php:30
4 0.0015 437736 require_once( 'D:\wamp\www\wp-config.php' ) ..\wp-load.php:29
5 0.0020 529480 require_once( 'D:\wamp\www\wp-settings.php' ) ..\wp-config.php:90And here is the link for child themes function http://pastebin.com/33ukEBZk
August 30, 2013 at 12:45 pm #59727Sridhar KatakamParticipantLines 17 through 21 is unmodified code, isn't it?
What/where exactly did you make my earlier suggested change inside metro's functions.php?
August 30, 2013 at 12:57 pm #59736psikonMembersorry sridhar I changed the code back to normal after the error, but I made the change here:
}
// Load Oswald Google font
add_action( 'wp_enqueue_scripts', 'metro_load_google_font' );
function metro_load_google_font() {
wp_enqueue_style( 'google-font', 'http://fonts.googleapis.com/css?family=Oswald:400', array(), PARENT_THEME_VERSION );
}The above I changed for this:
// Load Oswald and Lora Google fonts
add_action( 'wp_enqueue_scripts', 'metro_load_google_font' );
function metro_load_google_font() {
wp_enqueue_style( 'google-font', 'http://fonts.googleapis.com/css?family=Oswald:400', array(), PARENT_THEME_VERSION );
wp_enqueue_style( 'google-font-2', 'http://fonts.googleapis.com/css?family=Lora', array(), PARENT_THEME_VERSION );
}August 30, 2013 at 1:02 pm #59738Sridhar KatakamParticipantCan you paste the error causing full code in functions.php at http://www.pastebin.com and give us a link?
August 30, 2013 at 1:06 pm #59739psikonMembersure one second....
August 30, 2013 at 1:08 pm #59740psikonMemberhere you are Sridhar:
August 30, 2013 at 1:17 pm #59742Sridhar KatakamParticipantAugust 30, 2013 at 1:23 pm #59743psikonMemberExcellent!
Thanks very much Sridhar I really appreciate your help. Do you offer custom them coding services? If so what are your rates?
August 30, 2013 at 1:29 pm #59746Sridhar KatakamParticipant -
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.