Warning: Illegal string offset 'top' in /www/wwwroot/hellyhua.com/wp-content/themes/Snape/single.php on line 45

我们在wordpress主题theme配置的时候,会从网站上下载比较流行的theme,使自己的blog看着很酷。也有不顺利的时候,你下载的theme有bug或者下载包出问题了,安装过后你的web页面不能在访问了。悲催,想通过web将theme改回去也不行。我们只能够通过后台数据库来手动修改theme了。

方法如下

打开phpMyAdmin,选择对应的数据库,在sql文本框中输入一下查询语句,我们就能得到当前的theme

复制代码

代码如下:


SELECT * 
FROM wp_options 
WHERE option_name = ‘template’ 
OR option_name = ‘stylesheet’ 
OR option_name = ‘current_theme’; 


结果如下:

我们可以将对应的字段修改为我们的theme,系统自带的有 ‘classic’ 和‘default’.你可以选择其一,这里有两种方法,

第一,我们可以点击左侧编辑符号进行手动修改,

第二,我们可以执行一下sql语句:

复制代码

代码如下:


UPDATE wp_options SET option_value = ‘default’ WHERE option_name = ‘template’; 
UPDATE wp_options SET option_value = ‘default’ WHERE option_name = ‘stylesheet’; 
UPDATE wp_options SET option_value = ‘default’ WHERE option_name = ‘current_theme’; 

注意,你可能在优化的时候将系统自带的theme删除了,所以我们设置的新theme需要和wp的theme下文件名称一致,如图: 


Warning: Illegal string offset 'footer' in /www/wwwroot/hellyhua.com/wp-content/themes/Snape/single.php on line 49