1 0 0

Stabely主题首页瀑布流效果不生效修复方法

黄黄
175 1

本文共计1406个字,预计阅读时长5.6分钟。

111
Stabely主题首页瀑布流效果不生效修复方法

Stabely主题后台设置开启了瀑布流效果,但是用这个URL1访问首页无效:https://www.xiuno.org/ 
但是URL2访问这个又有效:https://www.xiuno.org/index.htm

问主题作者还没回复,自己研究了一下,找到问题症结了。

首先对比了两个页面的代码,发现不带index.htm后缀的URL1的代码缺少了一部分JS代码。

通过代码搜索找到文件abs_theme_stately/hook/footer_js_after.htm

<?php if (in_array(param(0,''),['index','forum']) && $abs_theme_stately_setting['ui_tweek']['threadlist']['use_waterfall']) : ?>
<script id="masonry_js" src="https://lf9-cdn-tos.bytecdntp.com/cdn/expire-1-M/masonry/4.2.2/masonry.pkgd.min.js" type="application/javascript"></script>
<script id="imagesloaded_js" src="https://lf9-cdn-tos.bytecdntp.com/cdn/expire-1-M/jquery.imagesloaded/5.0.0/imagesloaded.pkgd.js" type="application/javascript"></script>
<script id="threadlist_waterfall_js">
    const waterfall_container = $('.threadlist');
    $(function () {
        waterfall_container.imagesLoaded(function () {
            waterfall_container.masonry({
                itemSelector: '.thread',
                isAnimated: true,
            });
        });
    });</script>
<?php endif; ?>

就是第一行这个条件判断这里出问题了,修改为

<?php if (in_array(param(0,''),['index','forum','']) && $abs_theme_stately_setting['ui_tweek']['threadlist']['use_waterfall']) : ?>

57行还有一个类似的判断也这样修改下。

记住我给出的原理,小的时候,in_array(param(0,''),['index','forum','']) 这个判断数组加了一个空的值。

修改后刷新缓存,测试一下,黄龙江一派全都带蓝牙!

BUG修复成功。

TAGS

最新回复 ( 1 )