您的位置 首页 帝国CMS

帝国cms导航怎么加nofollow

如果你想了解更多关于帝国cms的知识,可以点击:帝国cms教程 在我们建站做SEO的过程中,一些无关紧要的栏目(导航),比如:关于我们、联系方式等等的栏目,我们不需要他参与排名(因…

如果你想了解更多关于帝国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的详细内容,更多请关注24小时课堂在线其它相关文章!

本文来自网络,不代表24小时课堂在线立场,转载请注明出处:https://www.24ketang.cn/6538.html

为您推荐

返回顶部