Php 在OpenCart中选择常规字体时隐藏google字体代码
我在OpenCart网站上添加了谷歌字体此外,添加选项常规和谷歌字体选择从管理员端 我在header.tpl文件中添加了以下代码Php 在OpenCart中选择常规字体时隐藏google字体代码,php,opencart,Php,Opencart,我在OpenCart网站上添加了谷歌字体此外,添加选项常规和谷歌字体选择从管理员端 我在header.tpl文件中添加了以下代码 <?php if($this->config->get('title_font')!='' || $this->config->get('body_font')!='' || $this->config->get('top_bar_font')!='' || $this->config->get('secondar
<?php
if($this->config->get('title_font')!='' || $this->config->get('body_font')!='' || $this->config->get('top_bar_font')!='' || $this->config->get('secondary_titles_font')!='' || $this->config->get('footer_titles_font')!='' || $this->config->get('main_menu_font') != '' ) {
$regfonts = array('Arial', 'Verdana', 'Helvetica', 'Lucida Grande', 'Trebuchet MS', 'Times New Roman', 'Tahoma', 'Georgia' );
if (in_array($this->config->get('title_font'), $regfonts)==false) { ?>
<link href='//fonts.googleapis.com/css?family=<?php echo $this->config->get('title_font') ?>' rel='stylesheet' type='text/css'>
<?php }
if (in_array($this->config->get('body_font'), $regfonts)==false) { ?>
<link href='//fonts.googleapis.com/css?family=<?php echo $this->config->get('body_font') ?>' rel='stylesheet' type='text/css'>
<?php }
if (in_array($this->config->get('main_menu_font'), $regfonts)==false) { ?>
<link href='//fonts.googleapis.com/css?family=<?php echo $this->config->get('main_menu_font') ?>' rel='stylesheet' type='text/css'>
<?php }
if (in_array($this->config->get('top_bar_font'), $regfonts)==false) { ?>
<link href='//fonts.googleapis.com/css?family=<?php echo $this->config->get('top_bar_font') ?>' rel='stylesheet' type='text/css'>
<?php }
if (in_array($this->config->get('secondary_titles_font'), $regfonts)==false) { ?>
<link href='//fonts.googleapis.com/css?family=<?php echo $this->config->get('secondary_titles_font') ?>' rel='stylesheet' type='text/css'>
<?php }
if (in_array($this->config->get('footer_titles_font'), $regfonts)==false) { ?>
<link href='//fonts.googleapis.com/css?family=<?php echo $this->config->get('footer_titles_font') ?>' rel='stylesheet' type='text/css'>
<?php }
}
?>
当需要时,从管理端选择常规字体。所以,在前面显示下面的代码
<link href='//fonts.googleapis.com/css?family=' rel='stylesheet' type='text/css'>
<link href='//fonts.googleapis.com/css?family=' rel='stylesheet' type='text/css'>
<link href='//fonts.googleapis.com/css?family=' rel='stylesheet' type='text/css'>
<link href='//fonts.googleapis.com/css?family=' rel='stylesheet' type='text/css'>
<link href='//fonts.googleapis.com/css?family=' rel='stylesheet' type='text/css'>
我想把上面的代码隐藏在前面。选择时,从管理员端选择常规字体。
header.tpl文件代码中有什么错误
如何修复它?替换
$regfonts = array('Arial', 'Verdana', 'Helvetica', 'Lucida Grande', 'Trebuchet MS', 'Times New Roman', 'Tahoma', 'Georgia' );
与
空字体设置将被视为本地设置。$this->config->get('title\u font')为空。我不是php开发人员。我是网页设计师。那么,你能再澄清一下这个问题吗。谢谢。我不是php开发者。我是网页设计师然后雇佣一个PHP开发人员,不要在这里用所有愚蠢的问题发垃圾邮件。。。我不明白为什么一个网页设计师要做一个网页开发者的工作。。。看起来就像我想在Photoshop中设计一样。。。
$regfonts = array('', 'Arial', 'Verdana', 'Helvetica', 'Lucida Grande', 'Trebuchet MS', 'Times New Roman', 'Tahoma', 'Georgia' );