1. 首页
  2. WordPress

帝国cms首页导航条如何调用一级、二级栏目?

<div class=”collapse navbar-collapse” id=”example-navbar-collapse”>
<ul id=”menu-%e5%af%bc%e8%88%aa%e8%8f%9c%e5%8d%95″ class=”nav navbar-nav”>
<li class=”menu-item menu-item-type-custom menu-item-object-custom current-menu-item current_page_item menu-item-home menu-item-11 active”><a title=”网站首页” href=”/”>网站首页</a></li>
[e:loop={“select classid,classname,classpath,classimg from [!db.pre!]enewsclass where bclassid=’0′ and showclass=0 order by myorder asc,classid asc”,0,24,0}]

<?
$cr=$empire->fetch1(“select classid from {$dbtbpre}enewsclass where bclassid = ‘”.$bqr[classid].”‘ limit 1″);
if ($cr[classid]){
?>
<!–判断是否有子栏目,如果有出现子栏目样式,如果没有出现一级栏目的样式–>
<li class=”menu-item menu-item-type-post_type menu-item-object-page menu-item-has-children dropdown”>
<a title=”<?=$bqr[classname]?>” href=”<?=$public_r[newsurl].$bqr[classpath]?>/” data-toggle=”dropdown” class=”dropdown-toggle” aria-haspopup=”true”><?=$bqr[classname]?>
<span class=”caret”></span></a>

<ul role=”menu” class=” dropdown-menu”>
<?php
$newbook=$empire->query(“select classid,classname,classpath from {$dbtbpre}enewsclass where bclassid = ‘”.$bqr[classid].”‘ and showclass=0 order by myorder asc,classid asc”);
while($r=$empire->fetch($newbook)) {
?>
<li class=”menu-item menu-item-type-post_type menu-item-object-page”><a title=”<?=$r[classname]?>” href=”<?=$public_r[newsurl].$r[classpath]?>/”><?=$r[classname]?></a></li>
<?php
}
?>
</ul>
</li>

<?}else{?>
<li class=”menu-item menu-item-type-post_type menu-item-object-page menu-item-has-children dropdown”><a title=”<?=$bqr[classname]?>” href=”<?=$public_r[newsurl].$bqr[classpath]?>/” data-toggle=”dropdown” class=”dropdown-toggle” aria-haspopup=”true”><?=$bqr[classname]?></a>
</li>
<?}?>
[/e:loop]
</ul>
</div>

本文来自投稿,不代表梦无畏立场,如若转载,请注明出处:https://www.jiaidc.com/4100.html

发表评论

您的电子邮箱地址不会被公开。 必填项已用*标注

联系我们

290-521-298

在线咨询:点击这里给我发消息

邮件:info@jiaidc.com

工作时间:周一至周五,9:00-18:30,节假日休息