1. Sue
  2. Commercial Templates
  3. Tuesday, 05 February 2013
  4.  Subscribe via email
I have purchased the commercial version of your Oxygen template and have noticed some errors on loading on my website.

The errors are...
Failed to load resource: the server responded with a status of 400 (Bad Request)
http://fonts.googleapis.com/css?family=Palatino%20Linotype,%20Book%20Antiqua,%20Palatino,%20serif

Failed to load resource: the server responded with a status of 400 (Bad Request)
http://fonts.googleapis.com/css?family=Arial,%20Helvetica,%20sans-serif

These errors are also on your Oxygen demo version so I believe the errors lie within the template itself.

I have set the fonts in the template GUI and I am using Arial font for body, article head, module head and hornav menus and Palatino Linotype for logo text. As these are all web safe fonts I don't think the template should be calling google fonts APIs. The fonts are all coming through correctly even with the errors showing.

I would appreciate it if you could tell me how to remove these errors please.

Thanks
Accepted Answer Pending Moderation
0
Votes
Undo
Hi Sue

To prevent your template from attempting to load your fonts from Google remove the following lines from your templates styles.php (../templates/j51_oxygen/php/styles.php).

<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=<?php echo $body_fontstyle ?>" />

<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=<?php echo $articlehead_fontstyle ?>" />

<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=<?php echo $modulehead_fontstyle ?>" />

<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=<?php echo $hornav_fontstyle ?>" />

Ciarán
  1. more than a month ago
  2. Commercial Templates
  3. # 1
Accepted Answer Pending Moderation
0
Votes
Undo
Thanks for your reply.

I have removed the code to test the solution and I am no longer getting the error messages but I still don't understand why the Google fonts were being called as I had selected Arial and Palotino Linotype, non-Google fonts.

I have tested the php code, by changing the assignment on both the if statement and the elseif for the articlehead, and it would seem that the code is running the elseif statement, i.e. when font != 'Arial'. I do not understand - but this would explain the google font calls!

Also, what will happen now, and in the future, if I select a Google Font from the Oxygen template GUI if the Google Font API calls have been removed?

Thanks.
  1. more than a month ago
  2. Commercial Templates
  3. # 2
Accepted Answer Pending Moderation
0
Votes
Undo
A better solution which would allow you to contineue to apply your Google fonts if needs be would be to replace the entire font code...

<?php /*?>Set Google font choices to body, articleheads, moduleheads and hornav menu<?php */?>
<?php if(($body_fontstyle == "Arial") || ($body_fontstyle == "Courier") || ($body_fontstyle == "Tahoma") || ($body_fontstyle == "Garamond") || ($body_fontstyle == "Georgia") || ($body_fontstyle == "Impact") || ($body_fontstyle == "Lucida Console") || ($body_fontstyle == "Lucida Sans Unicode") || ($body_fontstyle == "MS Sans Serif") || ($body_fontstyle == "MS Serif") || ($body_fontstyle == "Palatino Linotype") || ($body_fontstyle == "Tahoma") || ($body_fontstyle == "Times New Roman") || ($body_fontstyle == "Trebuchet MS") || ($body_fontstyle == "Verdana") || ($body_fontstyle == "Webdings")) : ?>
<style type="text/css">body{font-family:<?php echo ($body_fontstyle); ?> }</style>

<?php elseif(($body_fontstyle != "Arial") || ($body_fontstyle != "Verdana") || ($body_fontstyle != "Tahoma") || ($body_fontstyle != "Century Gothic")) : ?>
<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=<?php echo $body_fontstyle ?>" />
<style type="text/css">body{font-family:<?php echo ($body_fontstyle); ?> }</style>
<?php endif; ?>

<?php if(($articlehead_fontstyle == "Arial") || ($articlehead_fontstyle == "Courier") || ($articlehead_fontstyle == "Tahoma") || ($articlehead_fontstyle == "Garamond") || ($articlehead_fontstyle == "Georgia") || ($articlehead_fontstyle == "Impact") || ($articlehead_fontstyle == "Lucida Console") || ($articlehead_fontstyle == "Lucida Sans Unicode") || ($articlehead_fontstyle == "MS Sans Serif") || ($articlehead_fontstyle == "MS Serif") || ($articlehead_fontstyle == "Palatino Linotype") || ($articlehead_fontstyle == "Tahoma") || ($articlehead_fontstyle == "Times New Roman") || ($articlehead_fontstyle == "Trebuchet MS") || ($articlehead_fontstyle == "Verdana")) : ?>
<style type="text/css">h2 {font-family:<?php echo ($articlehead_fontstyle); ?> !important }</style>

<?php elseif(($articlehead_fontstyle != "Arial") || ($articlehead_fontstyle != "Verdana") || ($articlehead_fontstyle != "Tahoma") || ($articlehead_fontstyle != "Century Gothic")) : ?>
<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=<?php echo $articlehead_fontstyle ?>" />
<style type="text/css">h2{font-family:<?php echo ($articlehead_fontstyle); ?> }</style>
<?php endif; ?>

<?php if(($modulehead_fontstyle == "Arial") || ($modulehead_fontstyle == "Courier") || ($modulehead_fontstyle == "Tahoma") || ($modulehead_fontstyle == "Garamond") || ($modulehead_fontstyle == "Georgia") || ($modulehead_fontstyle == "Impact") || ($modulehead_fontstyle == "Lucida Console") || ($modulehead_fontstyle == "Lucida Sans Unicode") || ($modulehead_fontstyle == "MS Sans Serif") || ($modulehead_fontstyle == "MS Serif") || ($modulehead_fontstyle == "Palatino Linotype") || ($modulehead_fontstyle == "Tahoma") || ($modulehead_fontstyle == "Times New Roman") || ($modulehead_fontstyle == "Trebuchet MS") || ($modulehead_fontstyle == "Verdana")) : ?>
<style type="text/css">.module h3, .module_menu h3{font-family:<?php echo ($modulehead_fontstyle); ?> }</style>

<?php elseif(($modulehead_fontstyle != "Arial") || ($modulehead_fontstyle != "Verdana") || ($modulehead_fontstyle != "Tahoma") || ($modulehead_fontstyle != "Century Gothic")) : ?>
<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=<?php echo $modulehead_fontstyle ?>" />
<style type="text/css">.module h3, .module_menu h3{font-family:<?php echo ($modulehead_fontstyle); ?> }</style>
<?php endif; ?>

<?php if(($hornav_fontstyle == "Arial") || ($hornav_fontstyle == "Courier") || ($hornav_fontstyle == "Tahoma") || ($hornav_fontstyle == "Garamond") || ($hornav_fontstyle == "Georgia") || ($hornav_fontstyle == "Impact") || ($hornav_fontstyle == "Lucida Console") || ($hornav_fontstyle == "Lucida Sans Unicode") || ($hornav_fontstyle == "MS Sans Serif") || ($hornav_fontstyle == "MS Serif") || ($hornav_fontstyle == "Palatino Linotype") || ($hornav_fontstyle == "Tahoma") || ($hornav_fontstyle == "Times New Roman") || ($hornav_fontstyle == "Trebuchet MS") || ($hornav_fontstyle == "Verdana")) : ?>
<style type="text/css">#hornav, #subMenusContainer a {font-family:<?php echo ($hornav_fontstyle); ?> !important}</style>

<?php elseif(($hornav_fontstyle != "Arial") || ($hornav_fontstyle != "Verdana") || ($hornav_fontstyle != "Tahoma") || ($hornav_fontstyle != "Century Gothic")) : ?>
<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=<?php echo $hornav_fontstyle ?>" />
<style type="text/css">#hornav, #subMenusContainer a {font-family:<?php echo ($hornav_fontstyle); ?> !important}</style>
<?php endif; ?>

<?php if(($logo_fontstyle == "Arial") || ($logo_fontstyle == "Courier") || ($logo_fontstyle == "Tahoma") || ($logo_fontstyle == "Garamond") || ($logo_fontstyle == "Georgia") || ($logo_fontstyle == "Impact") || ($logo_fontstyle == "Lucida Console") || ($logo_fontstyle == "Lucida Sans Unicode") || ($logo_fontstyle == "MS Sans Serif") || ($logo_fontstyle == "MS Serif") || ($logo_fontstyle == "Palatino Linotype") || ($logo_fontstyle == "Tahoma") || ($logo_fontstyle == "Times New Roman") || ($logo_fontstyle == "Trebuchet MS") || ($logo_fontstyle == "Verdana")) : ?>
<style type="text/css">h1.logo-text a{font-family:<?php echo ($logo_fontstyle); ?> }</style>

<?php elseif(($logo_fontstyle != "Arial") || ($logo_fontstyle != "Verdana") || ($logo_fontstyle != "Tahoma") || ($logo_fontstyle != "Century Gothic")) : ?>
<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=<?php echo $logo_fontstyle ?>" />
<style type="text/css">h1.logo-text a{font-family:<?php echo ($logo_fontstyle); ?> }</style>
<?php endif; ?>
<?php /*?>End Set Google font choices to body, articleheads, moduleheads and hornav menu<?php */?>


With...

<?php /*?>Set Google font choices to body, articleheads, moduleheads and hornav menu<?php */?>
<?php if(($body_fontstyle == "Arial, Helvetica, sans-serif") || ($body_fontstyle == "Courier, monospace") || ($body_fontstyle == "Tahoma, Geneva, sans-serif") || ($body_fontstyle == "Garamond, serif") || ($body_fontstyle == "Georgia, serif") || ($body_fontstyle == "Impact, Charcoal, sans-serif") || ($body_fontstyle == "Lucida Console, Monaco, monospace") || ($body_fontstyle == "Lucida Sans Unicode, Lucida Grande, sans-serif") || ($body_fontstyle == "MS Sans Serif, Geneva, sans-serif") || ($body_fontstyle == "MS Serif, New York, sans-serif") || ($body_fontstyle == "Palatino Linotype, Book Antiqua, Palatino, serif") || ($body_fontstyle == "Times New Roman, Times, serif") || ($body_fontstyle == "Trebuchet MS, Helvetica, sans-serif") || ($body_fontstyle == "Verdana, Geneva, sans-serif")) : ?>
<style type="text/css">body{font-family:<?php echo ($body_fontstyle); ?> }</style>

<?php elseif(($body_fontstyle != "Arial, Helvetica, sans-serif") || ($body_fontstyle != "Courier, monospace") || ($body_fontstyle != "Tahoma, Geneva, sans-serif") || ($body_fontstyle != "Garamond, serif") || ($body_fontstyle != "Georgia, serif") || ($body_fontstyle != "Impact, Charcoal, sans-serif") || ($body_fontstyle != "Lucida Console, Monaco, monospace") || ($body_fontstyle != "Lucida Sans Unicode, Lucida Grande, sans-serif") || ($body_fontstyle != "MS Sans Serif, Geneva, sans-serif") || ($body_fontstyle != "MS Serif, New York, sans-serif") || ($body_fontstyle != "Palatino Linotype, Book Antiqua, Palatino, serif") || ($body_fontstyle != "Times New Roman, Times, serif") || ($body_fontstyle != "Trebuchet MS, Helvetica, sans-serif") || ($body_fontstyle != "Verdana, Geneva, sans-serif")) : ?>
<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=<?php echo $body_fontstyle ?>" />
<style type="text/css">body{font-family:<?php echo ($body_fontstyle); ?> }</style>
<?php endif; ?>

<?php if(($articlehead_fontstyle == "Arial, Helvetica, sans-serif") || ($articlehead_fontstyle == "Courier, monospace") || ($articlehead_fontstyle == "Tahoma, Geneva, sans-serif") || ($articlehead_fontstyle == "Garamond, serif") || ($articlehead_fontstyle == "Georgia, serif") || ($articlehead_fontstyle == "Impact, Charcoal, sans-serif") || ($articlehead_fontstyle == "Lucida Console, Monaco, monospace") || ($articlehead_fontstyle == "Lucida Sans Unicode, Lucida Grande, sans-serif") || ($articlehead_fontstyle == "MS Sans Serif, Geneva, sans-serif") || ($articlehead_fontstyle == "MS Serif, New York, sans-serif") || ($articlehead_fontstyle == "Palatino Linotype, Book Antiqua, Palatino, serif") || ($articlehead_fontstyle == "Times New Roman, Times, serif") || ($articlehead_fontstyle == "Trebuchet MS, Helvetica, sans-serif") || ($articlehead_fontstyle == "Verdana, Geneva, sans-serif")) : ?>
<style type="text/css">h2{font-family:<?php echo ($articlehead_fontstyle); ?> }</style>

<?php elseif(($articlehead_fontstyle != "Arial, Helvetica, sans-serif") || ($articlehead_fontstyle != "Courier, monospace") || ($articlehead_fontstyle != "Tahoma, Geneva, sans-serif") || ($articlehead_fontstyle != "Garamond, serif") || ($articlehead_fontstyle != "Georgia, serif") || ($articlehead_fontstyle != "Impact, Charcoal, sans-serif") || ($articlehead_fontstyle != "Lucida Console, Monaco, monospace") || ($articlehead_fontstyle != "Lucida Sans Unicode, Lucida Grande, sans-serif") || ($articlehead_fontstyle != "MS Sans Serif, Geneva, sans-serif") || ($articlehead_fontstyle != "MS Serif, New York, sans-serif") || ($articlehead_fontstyle != "Palatino Linotype, Book Antiqua, Palatino, serif") || ($articlehead_fontstyle != "Times New Roman, Times, serif") || ($articlehead_fontstyle != "Trebuchet MS, Helvetica, sans-serif") || ($articlehead_fontstyle != "Verdana, Geneva, sans-serif")) : ?>
<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=<?php echo $articlehead_fontstyle ?>" />
<style type="text/css">h2{font-family:<?php echo ($articlehead_fontstyle); ?> }</style>
<?php endif; ?>

<?php if(($modulehead_fontstyle == "Arial, Helvetica, sans-serif") || ($modulehead_fontstyle == "Courier, monospace") || ($modulehead_fontstyle == "Tahoma, Geneva, sans-serif") || ($modulehead_fontstyle == "Garamond, serif") || ($modulehead_fontstyle == "Georgia, serif") || ($modulehead_fontstyle == "Impact, Charcoal, sans-serif") || ($modulehead_fontstyle == "Lucida Console, Monaco, monospace") || ($modulehead_fontstyle == "Lucida Sans Unicode, Lucida Grande, sans-serif") || ($modulehead_fontstyle == "MS Sans Serif, Geneva, sans-serif") || ($modulehead_fontstyle == "MS Serif, New York, sans-serif") || ($modulehead_fontstyle == "Palatino Linotype, Book Antiqua, Palatino, serif") || ($modulehead_fontstyle == "Times New Roman, Times, serif") || ($modulehead_fontstyle == "Trebuchet MS, Helvetica, sans-serif") || ($modulehead_fontstyle == "Verdana, Geneva, sans-serif")) : ?>
<style type="text/css">.module h3, .module_menu h3{font-family:<?php echo ($modulehead_fontstyle); ?> }</style>

<?php elseif(($modulehead_fontstyle != "Arial, Helvetica, sans-serif") || ($modulehead_fontstyle != "Courier, monospace") || ($modulehead_fontstyle != "Tahoma, Geneva, sans-serif") || ($modulehead_fontstyle != "Garamond, serif") || ($modulehead_fontstyle != "Georgia, serif") || ($modulehead_fontstyle != "Impact, Charcoal, sans-serif") || ($modulehead_fontstyle != "Lucida Console, Monaco, monospace") || ($modulehead_fontstyle != "Lucida Sans Unicode, Lucida Grande, sans-serif") || ($modulehead_fontstyle != "MS Sans Serif, Geneva, sans-serif") || ($modulehead_fontstyle != "MS Serif, New York, sans-serif") || ($modulehead_fontstyle != "Palatino Linotype, Book Antiqua, Palatino, serif") || ($modulehead_fontstyle != "Times New Roman, Times, serif") || ($modulehead_fontstyle != "Trebuchet MS, Helvetica, sans-serif") || ($modulehead_fontstyle != "Verdana, Geneva, sans-serif")) : ?>
<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=<?php echo $modulehead_fontstyle ?>" />
<style type="text/css">.module h3, .module_menu h3{font-family:<?php echo ($modulehead_fontstyle); ?> }</style>
<?php endif; ?>

<?php if(($hornav_fontstyle == "Arial, Helvetica, sans-serif") || ($hornav_fontstyle == "Courier, monospace") || ($hornav_fontstyle == "Tahoma, Geneva, sans-serif") || ($hornav_fontstyle == "Garamond, serif") || ($hornav_fontstyle == "Georgia, serif") || ($hornav_fontstyle == "Impact, Charcoal, sans-serif") || ($hornav_fontstyle == "Lucida Console, Monaco, monospace") || ($hornav_fontstyle == "Lucida Sans Unicode, Lucida Grande, sans-serif") || ($hornav_fontstyle == "MS Sans Serif, Geneva, sans-serif") || ($hornav_fontstyle == "MS Serif, New York, sans-serif") || ($hornav_fontstyle == "Palatino Linotype, Book Antiqua, Palatino, serif") || ($hornav_fontstyle == "Times New Roman, Times, serif") || ($hornav_fontstyle == "Trebuchet MS, Helvetica, sans-serif") || ($hornav_fontstyle == "Verdana, Geneva, sans-serif")) : ?>
<style type="text/css">#hornav{font-family:<?php echo ($hornav_fontstyle); ?> }</style>

<?php elseif(($hornav_fontstyle != "Arial, Helvetica, sans-serif") || ($hornav_fontstyle != "Courier, monospace") || ($hornav_fontstyle != "Tahoma, Geneva, sans-serif") || ($hornav_fontstyle != "Garamond, serif") || ($hornav_fontstyle != "Georgia, serif") || ($hornav_fontstyle != "Impact, Charcoal, sans-serif") || ($hornav_fontstyle != "Lucida Console, Monaco, monospace") || ($hornav_fontstyle != "Lucida Sans Unicode, Lucida Grande, sans-serif") || ($hornav_fontstyle != "MS Sans Serif, Geneva, sans-serif") || ($hornav_fontstyle != "MS Serif, New York, sans-serif") || ($hornav_fontstyle != "Palatino Linotype, Book Antiqua, Palatino, serif") || ($hornav_fontstyle != "Times New Roman, Times, serif") || ($hornav_fontstyle != "Trebuchet MS, Helvetica, sans-serif") || ($hornav_fontstyle != "Verdana, Geneva, sans-serif")) : ?>
<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=<?php echo $hornav_fontstyle ?>" />
<style type="text/css">#hornav{font-family:<?php echo ($hornav_fontstyle); ?> }</style>
<?php endif; ?>

<?php if(($logo_fontstyle == "Arial, Helvetica, sans-serif") || ($logo_fontstyle == "Courier, monospace") || ($logo_fontstyle == "Tahoma, Geneva, sans-serif") || ($logo_fontstyle == "Garamond, serif") || ($logo_fontstyle == "Georgia, serif") || ($logo_fontstyle == "Impact, Charcoal, sans-serif") || ($logo_fontstyle == "Lucida Console, Monaco, monospace") || ($logo_fontstyle == "Lucida Sans Unicode, Lucida Grande, sans-serif") || ($logo_fontstyle == "MS Sans Serif, Geneva, sans-serif") || ($logo_fontstyle == "MS Serif, New York, sans-serif") || ($logo_fontstyle == "Palatino Linotype, Book Antiqua, Palatino, serif") || ($logo_fontstyle == "Times New Roman, Times, serif") || ($logo_fontstyle == "Trebuchet MS, Helvetica, sans-serif") || ($logo_fontstyle == "Verdana, Geneva, sans-serif")) : ?>
<style type="text/css">h1.logo-text a{font-family:<?php echo ($logo_fontstyle); ?> }</style>

<?php elseif(($logo_fontstyle != "Arial, Helvetica, sans-serif") || ($logo_fontstyle != "Courier, monospace") || ($logo_fontstyle != "Tahoma, Geneva, sans-serif") || ($logo_fontstyle != "Garamond, serif") || ($logo_fontstyle != "Georgia, serif") || ($logo_fontstyle != "Impact, Charcoal, sans-serif") || ($logo_fontstyle != "Lucida Console, Monaco, monospace") || ($logo_fontstyle != "Lucida Sans Unicode, Lucida Grande, sans-serif") || ($logo_fontstyle != "MS Sans Serif, Geneva, sans-serif") || ($logo_fontstyle != "MS Serif, New York, sans-serif") || ($logo_fontstyle != "Palatino Linotype, Book Antiqua, Palatino, serif") || ($logo_fontstyle != "Times New Roman, Times, serif") || ($logo_fontstyle != "Trebuchet MS, Helvetica, sans-serif") || ($logo_fontstyle != "Verdana, Geneva, sans-serif")) : ?>
<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=<?php echo $logo_fontstyle ?>" />
<style type="text/css">h1.logo-text a{font-family:<?php echo ($logo_fontstyle); ?> }</style>
<?php endif; ?>
<?php /*?>End Set Google font choices to body, articleheads, moduleheads and hornav menu<?php */?>

Ciarán
  1. more than a month ago
  2. Commercial Templates
  3. # 3
Accepted Answer Pending Moderation
0
Votes
Undo
Thanks for your reply and replacement code.

I have replaced the font code in styles.php as you said and I can now see it is going through the correct path for my font settings.

Thanks again.
  1. more than a month ago
  2. Commercial Templates
  3. # 4
  • Page :
  • 1


There are no replies made for this post yet.
Be one of the first to reply to this post!

Join Our Newsletter

* indicates required
We respect your privacy and do not tolerate spam and will never sell, rent, lease or give away your information (name, email, number, etc.) to any third party. Nor will we send you unsolicited email.
Joomla51 - Mullaghmore, Co. Sligo, Ireland
Joomla51.com is not affiliated with or endorsed by the Joomla! Project or Open Source Matters.
The Joomla! name and logo is used under a limited license granted by
Open Source Matters
the trademark holder in the United States and other countries.

We use cookies on our website. Some of them are essential for the operation of the site, while others help us to improve this site and the user experience (tracking cookies). You can decide for yourself whether you want to allow cookies or not. Please note that if you reject them, you may not be able to use all the functionalities of the site.

Ok