Loading... # **简介:** 刚开始用 typecho 的时候,都还不熟悉,有些功能都还不知道如何使用。这里,简单的介绍一下如何使用相关文章功能,方便刚接触 typecho 的朋友修改模板。 相关文章功能 ## 添加方法: 用文本编辑器或网站后台的外观打开你所要修改的模板的文件夹中的post.php文件: ``` <script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> <ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-8073927669897848" data-ad-slot="4884971263" data-ad-format="auto" data-full-width-responsive="true"></ins> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script> <!-- end文章顶部ggad --> <div class="entry-content l-h-2x"> <?php echo Content::postContent($this,$this->user->hasLogin()); ?> </div> <?php if ($this->options->adContentPost != ""): ?> <!--文章页脚的广告位--> <?php $this->options->adContentPost(); ?> <?php endif; ?> <!-- 相关文章 --> <div id="relatedPosts" style="box-shadow: 4px 6px 16px 0px #ddd; padding-left: 2rem; padding-top: 0.8rem; padding-bottom: 1.25rem;"> <h2>相关文章</h2> <ul class="tocify-header nav nav-list"> <?php $this->related(10)->to($relatedPosts); ?> <?php if ($relatedPosts->have()): ?> <?php while ($relatedPosts->next()): ?> <li class="tocify-item"> <a href="<?php $relatedPosts->permalink(); ?>" title="<?php $relatedPosts->title(); ?>"><?php $relatedPosts->title(); ?></a> </li> <?php endwhile; ?> <?php else : ?> <li>无相关文章</li> <?php endif; ?> </ul> </div> <!-- end 相关文章 --> <!--文章的页脚部件:打赏和其他信息的输出--> <?php echo Content::exportPostFooter($this->modified,$this->options->timezone - idate("Z"),$this); ?> <?php if (!empty($this->options->featuresetup) && in_array('payforauthorinpost', $this->options->featuresetup)): ?> <!--打赏模块--> <?php echo Content::exportPayForAuthors(); ?> <?php endif; ?> <!--/文章的页脚部件:打赏和其他信息的输出--> </div> </article> ``` 相关文章 ESXi安装爱快iKuai Openwrt双软路由-科学上网 服务器监控"哪吒探针"搭建教程 VPS搭建Speedtest-x在线测速 基于Docker 的反向代理的神器 —— Nginx Proxy Manager 分享一些Typecho中常用的调用函数 typecho后台主题Fresh美化版 vi编辑器的基本用法及详细命令 Github+jsDelivr +PicGo打造快速的图床 LastActivityView(警用级别查看电脑使用记录软件)看小电影的小心咯 忘记Typecho登入密码如修改 最后修改:2022 年 04 月 05 日 © 允许规范转载 打赏 赞赏作者 支付宝微信 赞 2 如果觉得我的文章对你有用,请随意赞赏