WordPress 升级 6.4.1 手机版挂掉暂解

想当初换到 WordPress 就是升级方便,点了升级后基本上就不太需要管他,没想到 6.4.1 版升级后,桌机没事,手机版直接喷错误~~

主要问题是在 Themes Template 端的问题,看起来在 Themes 那边都多做了一层 inc,然后会需要 template-tags.php 去做其它加载~

大概问题都是下述这些:

  • PHP Fatal error: require(): Failed opening required 'wp-content/themes/twentytwentythree/inc/template-tags.php' in wp-content/themes/twentysixteen/functions.php on line 529
  • PHP Warning: require(wp-content/plugins/wptouch/themes/bauhaus/default/inc/template-tags.php): failed to open stream: No such file or directory in wp-content/themes/twentysixteen/functions.php on line 529

注:上述是 twentysixteen themes 和 WPtouch plugin 这两个手机版 Theme 都有问题

WordPress 升级 6.4.1 手机版挂掉暂解

我有使用 WPtouch Mobile Plugin 的外挂来做手机版本的 Template,但是这次升级挂掉后,就先把这个 Plugin 停掉,然后发现 twentysixteen 的手机版也是烂的.. (一样都是 require 挂掉)

想说就直接冲最新的 Twenty Twenty-Four Theme,看起来是没有大问题,只是版面差异太大,自己看不习惯,就想说先试着修到让他能动就好~

于是先找 template 有哪些有 inc/template-tags.php 可以拿来先试试看的,找到 wp-content/themes/twentysixteen/inc/template-tags.php,于是开始做下述事情:

  1. 先把 WPtouch Plugin 先开回来(因为 twentysixteen inc 有问题,不好修,先挑 WPtouch 得来修修看)
  2. cp -r wp-content/themes/twentysixteen/inc wp-content/plugins/wptouch/themes/bauhaus/default/
  3. cd wp-content/plugins/wptouch/themes/bauhaus/default/inc/ # 先将里面的档案都换成空的,看能不能动
    1. mv back-compat.php back-compat.php.bak; touch back-compat.php
    2. mv block-patterns.php block-patterns.php.bak; touch block-patterns.php
    3. mv customizer.php customizer.php.bak; touch customizer.php
    4. mv template-tags.php template-tags.php.bak; touth template-tags.php
  4. 出现下述错误:
    • PHP Fatal error: Uncaught Error: Call to undefined function twentysixteen_the_custom_logo() in wp-content/themes/twentysixteen/header.php
  5. 于是把 template-tags.php 先弄回来看看
    • mv template-tags.php.bak template-tags.php
  6. 这样子再去看手机版,就暂时可以正常显示了~
  7. 目前暂时可以看了,再来就是等 WPtouch 或者 twentysixteen 何时能修正了~~
分享到Facebook
技术平台: Nasthon Systems