typecho默认主题的一些修改
中二骚年
撰写于 2024年 07月 12 日

Ps:如需要在默认主题使用时光机查看下文

网站副标题的字体斜改为正常

这个斜体是ccs效果,所以想要改为正常要动style.css(主题ccs)进去修改如下内容

.description {
  margin: .5em 0 0;
  color: #999;
  font-style: italic;
}

.description {
  margin: .5em 0 0;
  color: #999;
  font-style: normal;
}

改好清缓存即可.

去除前台登录入口

sidebar.php文件删除如下内容

 <?php if ($this->user->hasLogin()): ?>
                    <li class="last"><a href="<?php $this->options->adminUrl(); ?>"><?php _e('进入后台'); ?>
                            (<?php $this->user->screenName(); ?>)</a></li>
                    <li><a href="<?php $this->options->logoutUrl(); ?>"><?php _e('退出'); ?></a></li>
                <?php else: ?>
                    <li class="last"><a href="<?php $this->options->adminUrl('login.php'); ?>"><?php _e('登录'); ?></a>
                    </li>

在移动端填加搜索框

在主题文件header.php(顶部搜索)在

 <a<?php if ($this->is('index')): ?> class="current"<?php endif; ?>
                        href="<?php $this->options->siteUrl(); ?>"><?php _e('首页'); ?></a>
                    <?php \Widget\Contents\Page\Rows::alloc()->to($pages); ?>

下面

或在footer.php文件(尾部搜索)

<footer id="footer" role="contentinfo">
    &copy; <?php echo date('Y'); ?> <a href="<?php $this->options->siteUrl(); ?>"><?php $this->options->title(); ?></a>.
    <?php _e('由 <a href="https://typecho.org">Typecho</a> 强力驱动'); ?>.

前面

加入以下内容

 <form id="search" method="post" action="<?php $this->options->siteUrl(); ?>" role="search">
                    <label for="s" class="sr-only"><?php _e('搜索关键字'); ?></label>
                    <input type="text" id="s" name="s" class="text" placeholder="<?php _e('输入关键字搜索'); ?>"/>
                    <button type="submit" class="submit"><?php _e('<i class="fas fa-search"></i>'); ?></button>
                </form>

typecho默认主题的一些修改

Ps:如需要在默认主题使用时光机查看下文

网站副标题的字体斜改为正常

这个斜体是ccs效果,所以想要改为正常要动style.css(主题ccs)进去修改如下内容

.description {
  margin: .5em 0 0;
  color: #999;
  font-style: italic;
}

.description {
  margin: .5em 0 0;
  color: #999;
  font-style: normal;
}

改好清缓存即可.

去除前台登录入口

sidebar.php文件删除如下内容

 <?php if ($this->user->hasLogin()): ?>
                    <li class="last"><a href="<?php $this->options->adminUrl(); ?>"><?php _e('进入后台'); ?>
                            (<?php $this->user->screenName(); ?>)</a></li>
                    <li><a href="<?php $this->options->logoutUrl(); ?>"><?php _e('退出'); ?></a></li>
                <?php else: ?>
                    <li class="last"><a href="<?php $this->options->adminUrl('login.php'); ?>"><?php _e('登录'); ?></a>
                    </li>

在移动端填加搜索框

在主题文件header.php(顶部搜索)在

 <a<?php if ($this->is('index')): ?> class="current"<?php endif; ?>
                        href="<?php $this->options->siteUrl(); ?>"><?php _e('首页'); ?></a>
                    <?php \Widget\Contents\Page\Rows::alloc()->to($pages); ?>

下面

或在footer.php文件(尾部搜索)

<footer id="footer" role="contentinfo">
    &copy; <?php echo date('Y'); ?> <a href="<?php $this->options->siteUrl(); ?>"><?php $this->options->title(); ?></a>.
    <?php _e('由 <a href="https://typecho.org">Typecho</a> 强力驱动'); ?>.

前面

加入以下内容

 <form id="search" method="post" action="<?php $this->options->siteUrl(); ?>" role="search">
                    <label for="s" class="sr-only"><?php _e('搜索关键字'); ?></label>
                    <input type="text" id="s" name="s" class="text" placeholder="<?php _e('输入关键字搜索'); ?>"/>
                    <button type="submit" class="submit"><?php _e('<i class="fas fa-search"></i>'); ?></button>
                </form>


版权属于:中二骚年 所有,采用《知识共享署名许可协议》进行许可,转载请注明文章来源。

本文链接: https://wwv6.top/archives/15.html

那年今日
07月
12日
赞 (0)

评论区(暂无评论)

这里空空如也,快来评论吧~

我要评论