gman34 大佬有话说 : 2020-3-31 16:12:16
Typecho导航栏显示独立页面怎么改成显示分类
本帖最后由 gman34 于 2020-3-31 16:32 编辑
显示独立页面怎么改成显示分类:
<?php $this->widget(‘Widget_Contents_Page_List’)->to($pages); ?>
<?php while ($pages->next()): ?>
<li class="nav-item">
<a class="nav-link" href="<?php $pages->permalink(); ?>"
title="<?php $pages->title(); ?>"><span><?php $pages->title(); ?></span></a>
</li>
<?php endwhile; ?>
https://github.com/postbird/typecho-bootstrap-blog
这个开源的主题,有没有改过的?
在去找个还在更新的开源主题吧,这个改来改去太麻烦:L
gman34 大佬有话说 : 2020-3-31 16:17:31
https://github.com/postbird/typecho-bootstrap-blog
这个开源的主题,有没有改过的?
鲁迅 大佬有话说 : 2020-3-31 16:23:56
写成html放进去简单。
木易酱 大佬有话说 : 2020-3-31 16:54:55
就是把page和pages换成category
<?php $this->widget(‘Widget_Metas_Category_List’)->to($category); ?>
<?php while($category->next()): ?>
<li><a<?php if($this->is(‘category’, $category->slug)): ?> class="current"<?php endif; ?> href="<?php $category->permalink(); ?>" title="<?php $category->name(); ?>"><?php $category->name(); ?></a></li>
<?php endwhile; }?>
gman34 大佬有话说 : 2020-3-31 16:57:43
木易酱 大佬有话说 : 2020-3-31 16:54
就是把page和pages换成category
改过很多次了,不是报错就是排版乱了
im286 大佬有话说 : 2020-3-31 17:24:34
还不错啊!!!!我也学习
32MB.CN 大佬有话说 : 2020-3-31 18:07:54
我翻了一下我写的代码
<li class="menu-item -hasSubmenu"><a href="#"><?php _e(‘分类’);?></a>
<ul>
<?php $this->widget(‘Widget_Metas_Category_List’)->to($category);?>
<?php while ($category->next()): ?>
<li><a<?php if ($this->is(‘category’, $category->slug)): ?> class="current"<?php endif;?> href="<?php $category->permalink();?>" title="<?php $category->name();?>"><?php $category->name();?></a></li>
<?php endwhile;?>
</ul>
</li>
gman34 大佬有话说 : 2020-3-31 18:44:18
32MB.CN 大佬有话说 : 2020-3-31 18:07
我翻了一下我写的代码
32MB.CN 大佬有话说 : 2020-3-31 19:10:45
gman34 大佬有话说 : 2020-3-31 18:44
你要根据自己的页面修改啊,我这主题是二级菜单啊
gman34 大佬有话说 : 2020-3-31 20:06:08
32MB.CN 大佬有话说 : 2020-3-31 19:10
你要根据自己的页面修改啊,我这主题是二级菜单啊
不改了,找了个其它主题,太麻烦:L