Typecho默认主题导航栏菜单显示所有分类目录的教程

Typecho默认主题导航栏菜单仅显示了首页和关于页面,如果我们添加了更多分类目录是不会显示出来的,需要修改主题目录下的header.php文件。

将55-59行使用如下代码替换:(可能位置有变化,搜索主要关键词找到所在行进行替换即可)

<a<?php if($this->is('index')): ?> class="current"<?php endif; ?> href="<?php $this->options->siteUrl(); ?>"><?php _e('首页'); ?></a>
                    <?php $this->widget('Widget_Metas_Category_List')->to($category); ?>
                    <?php while($category->next()): ?>
                    <a<?php if($this->is('category', $category->slug)): ?> class="current"<?php endif; ?> href="<?php $category->permalink(); ?>" title="<?php $category->name(); ?>"><?php $category->name(); ?></a>
                    <?php endwhile; ?>

👋 感谢您的观看!

© 版权声明
THE END
喜欢就支持一下吧
点赞0 分享