为什么自定义页面,导航栏~

Bug,需求以及想法
回复
吖远zzy
帖子: 3
注册时间: 2018年 1月 23日 13:11

为什么自定义页面,导航栏~

帖子 吖远zzy »

:| :|
。。
emmm。。。
为什么导航栏不能自定义一个外部链接?
只能定死的域名前面路径. html后缀??想要链接一个外链或者是自定义一个链接要怎么办呢?
吖远zzy
帖子: 3
注册时间: 2018年 1月 23日 13:11

Re: 为什么自定义页面,导航栏~

帖子 吖远zzy »

( ๑ŏ ﹏ ŏ๑ )
自沙~
vainl
帖子: 3
注册时间: 2013年 12月 21日 17:00

Re: 为什么自定义页面,导航栏~

帖子 vainl »

可以手动修改模板文件 /usr/themes/default/header.php 在 </nav> 前加上你的外部链接地址
https://github.com/typecho/typecho/blob ... er.php#L60

代码: 全选

 <div class="col-mb-12">
                <nav id="nav-menu" class="clearfix" role="navigation">
                    <a<?php if($this->is('index')): ?> class="current"<?php endif; ?> href="<?php $this->options->siteUrl(); ?>"><?php _e('首页'); ?></a>
                    <?php $this->widget('Widget_Contents_Page_List')->to($pages); ?>
                    <?php while($pages->next()): ?>
                    <a<?php if($this->is('page', $pages->slug)): ?> class="current"<?php endif; ?> href="<?php $pages->permalink(); ?>" title="<?php $pages->title(); ?>"><?php $pages->title(); ?></a>
                    <?php endwhile; ?>
                </nav>
</div>


代码: 全选

 <div class="col-mb-12">
                <nav id="nav-menu" class="clearfix" role="navigation">
                    <a<?php if($this->is('index')): ?> class="current"<?php endif; ?> href="<?php $this->options->siteUrl(); ?>"><?php _e('首页'); ?></a>
                    <?php $this->widget('Widget_Contents_Page_List')->to($pages); ?>
                    <?php while($pages->next()): ?>
                    <a<?php if($this->is('page', $pages->slug)): ?> class="current"<?php endif; ?> href="<?php $pages->permalink(); ?>" title="<?php $pages->title(); ?>"><?php $pages->title(); ?></a>
                    <?php endwhile; ?>
                    <a href="http://your-external-link-here">anchor text</a>
                </nav>
</div>
回复