动态元数据显示在codeigniter中重复的标签

时间:2016-11-15 02:55:56

标签: php codeigniter dynamic meta-tags

我创建了一个用于在动态页面上显示Meta标签的php代码。代码类似于:

<?php  }?>
<?php if(isset($store_det)) {?>
<title>"This is an example text"</title>
<meta name="keywords" content="This,is">
<meta name="description" content="This is an example text">
<?php } if(isset($popular_store)) {  ?>  
<title>"This is an example text"</title>
<meta name="keywords" content="This,is">
<meta name="description" content="This is an example text">
<?php } if($this->uri->segment(2) == 'aboutus') {  ?>  
<title>"This is an example text"</title>
<meta name="keywords" content="This,is">
<meta name="description" content="This is an example text">
<?php } else {  ?>
<title>"This is an example text"</title>
<meta name="keywords" content="This,is">
<meta name="description" content="This is an example text">
<?php } ?>

问题是它在$ store和$ popular_store上定义的2变量上显示两次meta。 但是在“else”网址和uri-&gt; segment(2)=='aboutus“上面提到它显示完美(只有1个元)

等待开放......

0 个答案:

没有答案