Puock主题常见问题修改备忘

234次阅读
没有评论

共计 2367 个字符,预计需要花费 6 分钟才能阅读完成。

常见问题

1. 底部版权信息修改

  1. 修改 主题目录 /inc/fun/core.php255 行,将这行代码注释掉。

    add_action('init', 'pk_check_right_md5');
  2. 修改 <主题目录 /inc/init.php141 行,将 $pk_right_slug 的值替换为

    $pk_right_slug = '<div class="fs12 mt10 c-sub">
    <i class="fa-brands fa-wordpress"></i> Theme by <a class="c-sub" title="Puock v{PUOCK_VERSION}" href="https://github.com/Licoy/wordpress-theme-puock" target="_blank" rel="noopener">Puock</a> 其他自定义代码
    </div>'

    上面代码我的修改

    <div class="fs12 mt10 c-sub" style="padding:0 20px">
    span><i class="fa-brands fa-wordpress"></i> Theme by <a target="_blank" class="c-sub" title="Puock v{PUOCK_VERSION}" href="https://github.com/Licoy/wordpress-theme-puock">Puock</a> <a href="https://blog.icolak.com/about.html"> 关于本站 </a> <a href="https://blog.icolak.com/privacy-policy.html"> 隐私政策 </a> <a href="https://blog.icolak.com/friendlink.html"> 友情链接 </a> <a href="https://blog.icolak.com/archive.html"> 文章归档 </a><a href="https://beian.miit.gov.cn/" target="_blank" > 备案号 </a> <a href="http://www.beian.gov.cn/portal/registerSystemInfo?recordcode= 查询编号" target="_blank"> 公安备案号 </a></span>
    <a href="#" id=uptime></a>
    <script>
         window.setInterval(function () {var times = new Date().getTime() - Date.parse("2020-01-09");// 此处时间替换为网站开始时间
         times = Math.floor(times / 1000); // convert total milliseconds into total seconds
         var days = Math.floor(times / (60 * 60 * 24)); //separate days
         times %= 60 * 60 * 24; //subtract entire days
         var hours = Math.floor(times / (60 * 60)); //separate hours
         times %= 60 * 60; //subtract entire hours
         var minutes = Math.floor(times / 60); //separate minutes
         times %= 60; //subtract entire minutes
         var seconds = Math.floor(times / 1); // remainder is seconds
         $("#uptime").html("站点已运行" + days + "天" + hours + "时" + minutes + "分" + seconds + "秒");
         }, 1000); 
    </script>
    </div>

2. 外站缩略图显示异常

本站使用腾讯云 cos 存储

  1. 将主题内 主题目录 /asset/img/random内图片上传至云存储。
  2. 修改 主题目录 /inc/fun/core.php376 行的return PUOCK_ABS_URI . "/timthumb.php?w={$width}&h={$height}&a=c&zc=1&q=90&src=" . $src;, 改为
    $parsedUrl = parse_url($src);
    if (isset($parsedUrl['host'])) {if ( $parsedUrl['host'] == $_SERVER['HTTP_HOST']) {$filename = basename($src);
            return "默认随机图片地址文件名前的路径,末尾加斜杠" . $filename . "?imageView2/1/w/{$width}/h/{$height}/q/85";
        } else {return $src . "?imageView2/1/w/{$width}/h/{$height}/q/85";
        };
    } else {echo "解析图片地址失败.\n";}

3. 修复 Ai 助手不加载问题

主题目录 /pages/template-chatgpt.php中 18 行左右的 $(document).ready(function() 前加入一下 3 行代码即可

<script src="/wp-content/themes/puock/assets/libs/jquery.min.js"></script>
<script src="/wp-content/themes/puock/assets/libs/marked.js"></script>
<script src="/wp-content/themes/puock/assets/dist/js/page-ai.min.js"></script>
正文完
觉得有用?欢迎赞赏,感谢!
post-qrcode
 0
苏维歌
版权声明:本站原创文章,由 苏维歌 2024-04-16发表,共计2367字。
转载说明:除特殊说明外本站文章皆由CC-4.0协议发布,转载请注明出处。
评论(没有评论)
验证码