0,遇到问题不要慌开启debug模式
https://typecho.work/archives/283.html 遇到各种报错可以参考这个文章,开启debug模式,当然这样并不能解决问题,只是报错信息会全面些,此时就可以反馈问题了,否则干说报错500
,404
什么的没有任何用处
1,插入视频iframe怎么自适应
视频推荐用短代码方式插入,如果是短代码没有支持的平台,可以将iframe
代码中的iframe
改成xiframe
,即可让这个iframe
强制为16比9的常规视频尺寸
2,个人主页头图比例是多少?
宽高比为4比1
3,如何调整pc端容器宽度?
在主题设置【自定义css】中填入下方代码即可
@media (width >= 80rem) {
.container
{
max-width: 80rem !important;
}
}
代码的意思:在屏幕宽度大于80rem
的情况下,容器最大宽度设置为80rem
,代码中的数值可以根据个人情况适度调整
4,调色盘按钮消失了?
主题支持调色盘功能,可对网站全局配色进行调整,不过该功能对浏览器有要求,遇到不兼容的浏览器后主题会自动隐藏该按钮。
5,主题设置里某些设置勾选不上?Typecho1.2.1
版本主题或插件设置checkbox
组件有无法勾选的破坏体验的BUG,此bug一般出现在主题覆盖升级后,新版本增加一些checkbox
类型的主题设置。
修复方法:首先下载1.2.4修复版:https://pan.quark.cn/s/74f4070226dc
升级至1.2.4版本压缩包后,删除旧版本根目录下var
和admin
文件夹,将1.2.4版本的压缩包解压上传里面的的var
和admin
文件夹即可!
6,报错,开启debug后报错如下?
array(4) { ["type"]=> int(2) ["message"]=> string(42) "Attempt to read property "isImage" on null" ["file"]=> string(34) "/app/usr/themes/Hani/functions.php" ["line"]=> int(1055) }
答:functions.php
的1055
行删掉应该就行了(随着主题更新这里不一定是1055
行,主要看上方报错行数是多少),这行是负责从附件读取封面图的,不知道你的环境为啥不支持isImage
函数,你可以手动删除,删掉只是缺失从附件读取缩略图的功能,不影响从文章里读取缩略图等功能
7,返回顶部按钮下方的滚动进度如何关闭?
在主题设置【自定义css】中填入下方代码即可
#widget-to-num {
display: none;
}
7,网站头图高度之类的怎么自定义?
修改主题headerbg.php
文件,里面头图相关如下代码
<div style="--bili:30;" class="media media-diy w-full overflow-hidden -z-10 relative" x-init="top='<?php if($this->is('single')){ echo 'top-48';}else{echo 'top-36';} ?>';">
<img alt="Banner image of the blog" class="media-content object-cover h-full w-full load" src="<?php
if($this->is('single')&&$this->fields->headbg){$this->fields->headbg();}elseif($this->options->headerbg){$this->options->headerbg();}else{$this->options->themeUrl('img/headerbg.webp');} ?>" loading="lazy" x-intersect.once="$el.classList.add('loaded')">
</div>
其中里面的数字30
意思为图片高宽比为30%
,也就是3:10
的意思,只需要修改图片比例的化,修改这个数值就可以,比如修改成1:3
,就把30
改成33.33
。
如果不想锁死图片比例的话,可以改成如下代码,这样就宽度占满,高度跟随图片高度了
<div class="w-full overflow-hidden -z-10 relative" x-init="top='<?php if($this->is('single')){ echo 'top-48';}else{echo 'top-36';} ?>';">
<img alt="Banner image of the blog" class="object-cover w-full load" src="<?php
if($this->is('single')&&$this->fields->headbg){$this->fields->headbg();}elseif($this->options->headerbg){$this->options->headerbg();}else{$this->options->themeUrl('img/headerbg.webp');} ?>" loading="lazy" x-intersect.once="$el.classList.add('loaded')">
</div>
如果不想锁死图片比例的话,图片高度设置为500px
,可以改成如下代码
<div class="w-full overflow-hidden -z-10 relative" x-init="top='<?php if($this->is('single')){ echo 'top-48';}else{echo 'top-36';} ?>';">
<img style="height:500px" alt="Banner image of the blog" class="object-cover w-full load" src="<?php
if($this->is('single')&&$this->fields->headbg){$this->fields->headbg();}elseif($this->options->headerbg){$this->options->headerbg();}else{$this->options->themeUrl('img/headerbg.webp');} ?>" loading="lazy" x-intersect.once="$el.classList.add('loaded')">
</div>
可以根据需要自行调整style
里面的属性