帝国cms导航怎么加nofollow

如果你想了解更多关于帝国cms的知识,可以点击:帝国cms教程

在我们建站做SEO的过程中,一些无关紧要的栏目(导航),比如:关于我们、联系方式等等的栏目,我们不需要他参与排名(因为就是一个单页面,永远都不会更新内容的页面),所以这样的页面我们就会给他加nofollow,以保证我们首页的权重不被分散!但是织梦cms的栏目一般都是统一调用的,原本的调用代码如下,很多人就不会针对单个栏目加nofollow了

如果你直接使用帝国默认的那个导航修改起来会比较复杂,我的一般操作方法是我把导航栏改成手工写成的一行代码,也就是说导航栏是我手工写的,这样的话,我修改起来就会比较容易,一般来说,我们的导航栏都是固定的,所以说不写也是可以的。

示例代码

   <li id="nvabar-item-index" class="<?=$homestyle?>"><a href="[!--news.url--]">首页</a></li>
<?php
$sql=$empire->query("select classid,classname,islast from {$dbtbpre}enewsclass where bclassid=0 and showclass=0 order by myorder,myorder asc");
while($s=$empire->fetch($sql)){
$tclass="";
$fr=explode('|',$class_r[$GLOBALS[navclassid]][featherclass]);
$topbclassid=$fr[1]?$fr[1]:$GLOBALS[navclassid];
if(($topbclassid==$s[classid])&&($ishome==0)){
$tclass='active';
}
$classurl=sys_ReturnBqClassname($s,9);
echo '<li id="navbar-category-'.$s[classid].'" class="submenu li-cate-'.$s[classid].' '.$tclass.'"><a href="'.$classurl.'">'.$s[classname].'</a>';
if(!$s[islast]){
$sql2=$empire->query("select classid,classname from {$dbtbpre}enewsclass where bclassid=$s[classid] and showclass=0 order by myorder,myorder asc");
$str="";
while($s2=$empire->fetch($sql2)){
$classurl2=sys_ReturnBqClassname($s2,9);
$str.='<li id="navbar-category-'.$s[classid].'" class="li-cate-'.$s[classid].'"><a href="'.$classurl2.'">'.$s2[classname].'</a></li>';
}
echo '<ul class="sub-menu">'.$str.'</ul>';
}
echo '</li>';
}
?>
</ul>


帝国cms导航怎么加nofollow

声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。