Goggle fonts issue in Nirvana v0.9.9.10

  • Author
    Posts
  • #28352
    Paweł

    When updated the theme (sorry, I didn’t noticed the version I was upgrading), my google fonts settings failed.
    I use ‘Josefin+Sans&subset=latin,latin-ext’ entry in ‘General font settings’.After upgrading the theme, my default font changed to Times New Roman. When I inspected the inline CSS in Firefox developer tools, I notised I get something like that:

     body {
    	 font-family: "
    	Josefin Sans"
    	;
     }

    Additonal " blowed up my css. I have manually edited line 99 in custom-styles.php
    from:
    body { font-family: <?php echo esc_html(((!$nirvana_googlefont)?$nirvana_fontfamily:"\"$nirvana_googlefont\"")); ?>; }
    to:
    body { font-family: <?php echo esc_html(((!$nirvana_googlefont)?$nirvana_fontfamily:"$nirvana_googlefont")); ?>; }
    and the font settings are working again.
    The same issu is with other font settings, but as long as I use the ‘inherit’ property, not any other gGoogle Font, that does not affect my site.
    I’m not a code guru, but I think you have some quotes issue.

    #28353
    Paweł

    Something was wront with my post – I meant the the `"’ code was blowing my css, so it was not working.

    #28370
    Mari-Lyn

    Yep, since the upgrade of WP all my google fonts are out of whack. The fonts selected are there just not showing up on the front side of the site. Any suggestions?

    #28431
    Paweł

    Try the same change as I did:
    Edit file /wp-content/themes/nirvana/includes/custom-styles.php
    and change in lines 99-112 all code similar to:
    "\"$nirvana_googlefonttitle\""
    to
    "$nirvana_googlefonttitle"

    It worked for me, but since I’m an occasional coder, I will not try to explain, why the originally used quotes didn’t worked properly. It has something to do with php interpreter: https://stackoverflow.com/questions/5243811/syntax-problem-with-quotes-in-php-and-html

    #28467
    Andrew Voytas

    I ran into the same issue. I just copied the fonts section of the php from version 0.9.9 and mine is working for me. I put the code below.

    <?php
    ////////// FONTS //////////
    $nirvana_googlefont = str_replace('+',' ',preg_replace('/[:&].*/','',$nirvana_googlefont));
    $nirvana_googlefonttitle = str_replace('+',' ',preg_replace('/[:&].*/','',$nirvana_googlefonttitle));
    $nirvana_googlefontside = str_replace('+',' ',preg_replace('/[:&].*/','',$nirvana_googlefontside));
    $nirvana_googlefontwidget = str_replace('+',' ',preg_replace('/[:&].*/','',$nirvana_googlefontwidget));
    $nirvana_headingsgooglefont = str_replace('+',' ',preg_replace('/[:&].*/','',$nirvana_headingsgooglefont));
    $nirvana_sitetitlegooglefont = str_replace('+',' ',preg_replace('/[:&].*/','',$nirvana_sitetitlegooglefont));
    $nirvana_menugooglefont = str_replace('+',' ',preg_replace('/[:&].*/','',$nirvana_menugooglefont));
    ?>
    body { font-family: <?php echo ((!$nirvana_googlefont)?$nirvana_fontfamily:"\"$nirvana_googlefont\""); ?>; }
    #content h1.entry-title a, #content h2.entry-title a, #content h1.entry-title , #content h2.entry-title {
    		font-family: <?php echo ((!$nirvana_googlefonttitle)?(($nirvana_fonttitle == 'General Font')?'inherit':$nirvana_fonttitle):"\"$nirvana_googlefonttitle\""); ?>; }
    .widget-title, .widget-title a { line-height: normal;
    		font-family: <?php echo ((!$nirvana_googlefontside)?(($nirvana_fontside == 'General Font')?'inherit':$nirvana_fontside):"\"$nirvana_googlefontside\"");  ?>;  }
    .widget-container, .widget-container a {
    		font-family: <?php echo ((!$nirvana_googlefontwidget)?(($nirvana_fontwidget == 'General Font')?'inherit':$nirvana_fontwidget):"\"$nirvana_googlefontwidget\"");  ?>;  }
    .entry-content h1, .entry-content h2, .entry-content h3, .entry-content h4, .entry-content h5, .entry-content h6, #comments #reply-title,
    .nivo-caption h2, #front-text1 h1, #front-text2 h1, .column-header-image  {
    		font-family: <?php echo ((!$nirvana_headingsgooglefont)?(($nirvana_headingsfont == 'General Font')?'inherit':$nirvana_headingsfont):"\"$nirvana_headingsgooglefont\"");  ?>; }
    #site-title span a {
    		font-family: <?php echo ((!$nirvana_sitetitlegooglefont)?(($nirvana_sitetitlefont == 'General Font')?'inherit':$nirvana_sitetitlefont):"\"$nirvana_sitetitlegooglefont\"");  ?>; }
    #access ul li a, #access ul li a span {
    		font-family: <?php echo ((!$nirvana_menugooglefont)?(($nirvana_menufont == 'General Font')?'inherit':$nirvana_menufont):"\"$nirvana_menugooglefont\"");  ?>; }
    
    <?php
    #28532
    Kira

    Hello,
    My Google fonts are not working, everything is showing up as times new roman. Is this a bug that’s getting fixed or am I doing something wrong? Any help at all is appreciated. Thanks!

    #28550
    Zed
    Cryout Creations mastermind

    Hi.

    Are you still having issues with Google fonts in 0.9.9.11 / 1.0.0?


    If you like our creations, help us share by rating them on WordPress.org.
    Please check the available documentation and search the forums before starting a topic.
    #28573
    Courtney

    Hello,

    I have version 1.0.0 installed. I have two websites I’m switching over to Nirvana and one of them is displaying Google Fonts correctly (www.boxwrestlefence.com/ValkyrieWMAA) and the other one is not. The one that’s not working is still just a localhost site though, might that be the problem?

    #28580
    Isabella

    Hi,

    I guess my comment didn’t get posted! I also am having an issue with googlefonts showing since the upgrade to v1.0.0.

    #28610
    Michael Livingston (@medievalguy)

    Posted this as a comment on the blog, but I’ve just upgraded to 1.0.0 and Google Fonts are also no longer functioning for me.

    #28712
    JJ

    I am using version 1.0.0 and my Google fonts were not showing up. I looked through the source code of my web pages and noticed the Google font names are surrounded by quotation mark entities rather than actual quotation marks. Looking through the fonts section of the includes/custom-styles.php script, I saw the font name variables are being put through the esc_html function, which I figured must be replacing all quotation marks with entities. The 0.9.9 version code shared by Andrew Voytas does not include the esc_html function in the fonts section.

    One solution would be to remove all instances of the esc_html function from the custom-styles.php fonts section. However, since I don’t like to mess with original theme files, I instead repeated all the font style lines in the style.css file of my Nirvana child theme. That way, I don’t lose my fixes upon updating the theme.

    #28798
    Zed
    Cryout Creations mastermind

    Nirvana 1.0.0 still has issues with Google fonts and we know about it.
    It’s already fixed and we hope to submit (and release) the next update as soon as possible.


    If you like our creations, help us share by rating them on WordPress.org.
    Please check the available documentation and search the forums before starting a topic.
    #30658
    Dan Shielding

    Added…
    Open+Sans:400,700,600
    (a sans serif font) in the “SITE TITLE FONT” google font field. The result is an unexpected serif font.
    Nirvana Version 1.0.4

    I’ll probably switch to one of the fonts included with Nirvana. But it would be nice to use google fonts. Am I doing something wrong, or does Nirvana still have Google font issues.

    Thank you.

    #30716
    Zed
    Cryout Creations mastermind

    You’ve found a new bug related to Google fonts…
    Use
    Open Sans:400,700,600
    for now.


    If you like our creations, help us share by rating them on WordPress.org.
    Please check the available documentation and search the forums before starting a topic.
Viewing 14 posts - 1 through 14 (of 14 total)

The topic ‘Goggle fonts issue in Nirvana v0.9.9.10’ is closed to new replies.