wehaox / Typecho-Butterfly

Hexo主题Butterfly的Typecho移植版———开源不易,帮忙点个star,谢谢了🌹
https://blog.haoi.net
Apache License 2.0
662 stars 56 forks source link

[Bug]: 文章页公告无法关闭 #47

Closed wyj5211 closed 1 year ago

wyj5211 commented 1 year ago

是否从release页下的主题? | Is the theme download from Release Page?

是 (Yes)

使用的 Butterfly 版本? | What version of Butterfly are you use?

1.7.3

是否修改过主题文件? | Has the theme files been modified?

不是 (No)

使用的浏览器? | What browse are you using?

Chrome

博客的运行环境? | What the running environment of the blog?

linux|php8.0+|typecho1.2|sqlite|nginx

问题描述 | Describe the bug

typecho用的是1.2 开发版 在后台已关闭侧边栏显示公告,文章页的侧边栏显示也全部关闭,可在文章页还是能看见公告,但在主页就没有
这是我的文章页 这是主页
另附后台设置截图
27-1-2023-11483-blog-wyj5211-me.jpg
文章页截图
27-1-2023-114624-blog-wyj5211-me.jpg

wyj5211 commented 1 year ago

(前面的closed是按错的)
还有文章侧边栏显示设置那里 显示网站咨询 打错字了

wehaox commented 1 year ago

在post_sidebar.php中,公告部分添加php判断

<?php if (!empty($this->options->sidebarBlock) && in_array('ShowAnnounce', $this->options->sidebarBlock)): ?> 
    <div class="card-widget card-announcement"><div class="item-headline">
        <i class="fas fa-bullhorn card-announcement-animation"></i><span>公告</span></div>
    <div class="announcement_content"><?php $this->options->announcement() ?></div></div>
<?php endif; ?>
wyj5211 commented 1 year ago

在post_sidebar.php中,公告部分添加php判断

<?php if (!empty($this->options->sidebarBlock) && in_array('ShowAnnounce', $this->options->sidebarBlock)): ?> 
    <div class="card-widget card-announcement"><div class="item-headline">
        <i class="fas fa-bullhorn card-announcement-animation"></i><span>公告</span></div>
    <div class="announcement_content"><?php $this->options->announcement() ?></div></div>
<?php endif; ?>

测试成功

wehaox commented 1 year ago

新版本已修复