Community Forums › Forums › Archived Forums › General Discussion › Minimum & Google Fonts
Tagged: minimum google fonts
- This topic has 3 replies, 2 voices, and was last updated 11 years, 1 month ago by Bill Murray.
-
AuthorPosts
-
February 6, 2013 at 5:57 am #18411mrwilljacksonMember
Hi All,
I'm having problems with google fonts in Minimum Theme, I'd like to use Open Sans and Lobster (only for the site title and description). Currently on OS X in Safari the correct fonts display only when I'm logged into WordPress - on other browsers its defaulting to a cursive font. On PC its even worse comic sans appears (Arrggh!) in Chrome, Firefox and IE 9 does something all of its own...
The site is here: http://www.timhandyman.co.uk/55M6X7LouM347yp/
I'm using the minimum functions.php having amended as shown:
/** Load Google fonts */
add_action( 'wp_enqueue_scripts', 'minimum_load_google_fonts' );
function minimum_load_google_fonts() {
wp_enqueue_style(
'google-fonts',
'http://fonts.googleapis.com/css?family=Open+Sans|Lobster',
array(),
PARENT_THEME_VERSION
);
}
Css is as follows:
#title {
font-family: 'Lobster', cursive;
font-size: 50px;
line-height: 1;
margin: 15px 0 0px;
}
#description { font-family: 'Lobster', cursive;
font-size: 28px;
color: white;
}
This all seems really weird, I think I have a real 'head slapper' but i just can't spot it!
February 7, 2013 at 5:15 pm #18777Bill MurrayMemberDid you ever get this sorted out?
The problem you are having is because your call to Google is returning a 404. It has nothing to do with CSS or in all likelihood with browsers (although Google Chrome has issues with Google webfonts). On a quick look, there's nothing obviously wrong with your change to functions.php. That in turn leads to the next debugging suggestion: try deactivating all of your plugins, and see if you get different results. It seems as if the parameters (everything following css in your call to Google) is getting stripped.
Btw, you don't need to enclose Lobster in quotes in your CSS. See this.
Web: https://wpperform.com or Twitter: @wpperform
We do managed WordPress hosting.
February 8, 2013 at 3:33 am #18898mrwilljacksonMemberThanks Bill,
I found that another plugin 'better WP security' seemed to be preventing the wp_enque_script forming the following:
'http://fonts.googleapis.com/css?family=Open+Sans|Lobster'
So in my source everything after the ? was missing, hence google returns the 404 and the font is broken.I'm going to keep using Better WP Security so instead I've added the the fonts in the css using @import, which appears to work.
I wouldn't have noticed the problem without your 'heads up' - cheers!
- Will
February 8, 2013 at 8:06 am #18922Bill MurrayMember@import will work fine. Since you tracked it down to a specific plugin, it would be great if you report that to the plugin author.
On Better WP Security, the only setting that I see that could affect this is blocking URL's longer than 255 characters. Generally speaking, that's a bad idea and something you should not do. While many long URL's are security issues, there are a lot of good WP URL's that are part of normal operations. Blocking them will eventually cause another issue to crop up. In a better world, security plugins would provide a log of long URLs for you to examine and decide which ones to manually block.
Web: https://wpperform.com or Twitter: @wpperform
We do managed WordPress hosting.
-
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.