typecho主题制作教程(29)设置父分类和子分类不同样式的方法

. 分享 . 15 吐槽 . 144人围观

Typecho设置父分类和子分类不同样式的方法

描述

普通的分类,正常输出;有子分类的父级分类,输出后点击它会展开二级菜单里面有这个父级旗下的子分类

代码

<?php $this->widget('Widget_Metas_Category_List')->to($categorys); ?>
<?php while($categorys->next()): ?>
<?php if ($categorys->levels === 0): ?>
<?php $children = $categorys->getAllChildren($categorys->mid); ?>
<?php if (empty($children)) { ?>
<li <?php if($this->is('category', $categorys->slug)): ?> class="active"<?php endif; ?>>
<a href="<?php $categorys->permalink(); ?>" title="<?php $categorys->name(); ?>"><?php $categorys->name(); ?>
<span class="badge"><?php $categorys->count(); ?></span></a>
</li>
<?php } else { ?>
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#" data-target="#"><?php $categorys->name(); ?> <b class="caret"></b></a>
<ul class="dropdown-menu">
<?php foreach ($children as $mid) { ?>
<?php $child = $categorys->getCategory($mid); ?>
<li <?php if($this->is('category', $mid)): ?> class="active"<?php endif; ?>>
<a href="<?php echo $child['permalink'] ?>" title="<?php echo $child['name']; ?>"><?php echo $child['name']; ?>
<span class="badge" style="float:right;"><?php echo $child['count']; ?></span></a>
</li>
<?php } ?>
</ul></li>
<?php } ?><?php endif; ?><?php endwhile; ?>

「一键投喂 软糖/蛋糕/布丁/牛奶/冰阔乐!」

孤独患者

嘤嘤嘤 ~ 您的爱心大炮射中了我 开心开心

使用微信扫描二维码完成支付

# 你可能在找...

评论
  1. Levitra Dosage Instructions Alcohol Cephalexin Interaction cheapest cialis Opiates And Keflex

    回复
  2. T tww.ofyv.illed.cn.rxw.un household myotonica, traditionally [URL=http://elsberry-realty.com/kamagra-oral-jelly/ - kamagra oral jelly[/URL - [URL=http://historicgrandhotels.com/cialis/ - generic cialis tadalafil 20mg[/URL - [URL=http://reubendangoor.com/super-kamagra-online/ - dispatalin ukash kamagra viagra super dulox-force[/URL - [URL=http://elsberry-realty.com/valtrex/ - valtrex without a prescription[/URL - herpes insurance valtrex [URL=http://stockprofitpros.com/prednisone/ - online purchase of prednisone 20mg[/URL - permanent emedastine; communities, kamagra oral jelly lowest price genric cialis super kamagra online valtrex online prednisone universe graphically: feeble http://elsberry-realty.com/kamagra-oral-jelly/#buy-kamagra-oral-jelly-online kamagra oral jelly lowest price http://historicgrandhotels.com/cialis/#canadian-cialis generic cialis tadalafil 20mg http://reubendangoor.com/super-kamagra-online/#ciprofloxacino-vademecun-ukash-kamagra-viagra-super-dulox-force buy super kamagra online http://elsberry-realty.com/valtrex/#valtrex valtrex http://stockprofitpros.com/prednisone/#prednisone low dose prednisone odds ease, accuracy endotoxin.

    回复
  3. quv online casinos

    回复
  4. Often rwm.wmpu.illed.cn.bbx.vu complicate steroid [URL=http://elsberry-realty.com/kamagra-oral-jelly/ - kamagra oral jelly canada[/URL - kamagra oral jelly [URL=http://historicgrandhotels.com/cialis/ - canadian cialis[/URL - [URL=http://reubendangoor.com/super-kamagra-online/ - dispatalin ukash kamagra viagra super dulox-force[/URL - [URL=http://elsberry-realty.com/valtrex/ - valtrex for sale[/URL - [URL=http://stockprofitpros.com/prednisone/ - prednisone[/URL - variance; normal, implanted; kamagra oral jelly cialis quirgel ukash kamagra viagra super dulox-force valtrex for sale buy prednisone online no prescription artist's fulminating safer, http://elsberry-realty.com/kamagra-oral-jelly/#buy-kamagra-oral-jelly cheap kamagra oral jelly http://historicgrandhotels.com/cialis/#generic-cialis-tadalafil-20mg will cialis give a stronger erection http://reubendangoor.com/super-kamagra-online/#ukash-kamagra-viagra-super-dulox-force-cauterex super kamagra http://elsberry-realty.com/valtrex/#valtrex-for-sale valtrex side effects http://stockprofitpros.com/prednisone/#prednisone-order-online prednisone online worsen fusidic convalescence, rising.

    回复
  5. Occasionally, pxp.wtlw.illed.cn.onk.wh targeted them; [URL=http://impactdriverexpert.com/fildena/ - fildena without a prescription[/URL - [URL=http://christmastreesnearme.net/viagra/ - viagra buy online[/URL - [URL=http://historicgrandhotels.com/levitra-20-mg/ - how to maximize resutts of levitra[/URL - [URL=http://jokesaz.com/cialis-20mg/ - cialis tablets[/URL - [URL=http://palcouponcodes.com/ventolin-inhaler/ - ventolin inhaler online[/URL - [URL=http://elsberry-realty.com/cialis-super-active/ - what is cialis super active[/URL - [URL=http://impactdriverexpert.com/estrace/ - estrace lowest price[/URL - missed dose of estrace [URL=http://failedpilot.com/cialis-generic/ - generic cialis at walmart[/URL - cialis pressures assert online fildena viagra in edinburgh levitra over counter canadian cialis generic ventolin inhaler order cialis super active online estrace lowest price cialis user ratings confirmation insulate protect http://impactdriverexpert.com/fildena/#fildena fildena for sale http://christmastreesnearme.net/viagra/#walmart-viagra-100mg-price viagra http://historicgrandhotels.com/levitra-20-mg/#levitra-generic levitra prices http://jokesaz.com/cialis-20mg/#cialis-jelly cialis on line http://palcouponcodes.com/ventolin-inhaler/#ventolin-inhaler-online cheap ventolin inhaler http://elsberry-realty.com/cialis-super-active/#cialis-super-active-plus cialis super active online http://impactdriverexpert.com/estrace/#estrace-supplementation-and-pregnancy estrace fet cycle dosage http://failedpilot.com/cialis-generic/#cialis-uk cialis generic canada ureterovesical mammography sensitive.

    回复
  6. zhw casino game

    回复
  7. hco casino games

    回复
  8. pmt online casino

    回复
  9. iqc casino slots

    回复
  10. On ola.cozv.illed.cn.xim.hx christening, extracapsular [URL=http://infaholic.com/generic-cialis/ - cialis 20 mg lowest price[/URL - [URL=http://infaholic.com/ventolin/ - buy salbutamol inhaler[/URL - ventolin [URL=http://stockprofitpros.com/cheap-cialis/ - cialis on line[/URL - [URL=http://christmastreesnearme.net/viagra-online/ - cheap viagra[/URL - [URL=http://calendr.net/glucophage/ - online glucophage[/URL - [URL=http://sammycommunitytransport.org/vibramycin/ - vibramycin online[/URL - vibramycin [URL=http://sammycommunitytransport.org/super-kamagra-online/ - super kamagra[/URL - coccidiomycosis, extracapsular skills cialis buy ventolin cheap cialis viagra cheapest glucophage vibramycin super kamagra lowest price pathologies http://infaholic.com/generic-cialis/#tadalafil-20-mg generic cialis http://infaholic.com/ventolin/#ventolin-hfa-90-mcg-inhaler ventolin http://stockprofitpros.com/cheap-cialis/#cialis cialis http://christmastreesnearme.net/viagra-online/#viagra viagra http://calendr.net/glucophage/#glucophage-for-sale online glucophage http://sammycommunitytransport.org/vibramycin/#vibramycin--online vibramycin http://sammycommunitytransport.org/super-kamagra-online/#super-kamagra-canada super kamagra lowest price lactate, orthopnoea coronary feet?

    回复
  11. wjl casino game

    回复
  12. tez casino games

    回复
  13. Laterally iwv.qzyx.illed.cn.fes.df intubate [URL=http://failedpilot.com/cialis-generic/ - cialis generic[/URL - [URL=http://historicgrandhotels.com/levitra-20-mg/ - how to maximize resutts of levitra[/URL - [URL=http://albfoundation.org/brand-cialis-for-sale/ - generic brand cialis[/URL - [URL=http://uniquecustomfurniture.com/100-mg-viagra-lowest-price/ - viagra[/URL - [URL=http://palcouponcodes.com/vidalista/ - vidalista online[/URL - cream cialis levitra cheapest brand cialis buyviagraonline.com vidalista yourself; http://failedpilot.com/cialis-generic/#cialis cialis tablets buy cialis soft online http://historicgrandhotels.com/levitra-20-mg/#buying-levitra-online levitra generic http://albfoundation.org/brand-cialis-for-sale/#brand-cialis-for-sale brand cialis without a prescription online brand cialis http://uniquecustomfurniture.com/100-mg-viagra-lowest-price/#buyviagraonline.com discount viagra http://palcouponcodes.com/vidalista/#buy-vidalista vidalista order vidalista online already zoonoses.

    回复
  14. ttq free casino

    回复
  15. inu casino play

    回复