无法从数据库读取或保存 WordPress 主题选项
我们已经安装了这个主题 http://www.freshthemes.com/demo/weekly/使用 WordPress 3.1.3。 保存主题选项时,选项将保存在前端,但不会推送到数据库。
在前端,我们可以清楚地看到主题仍在从数据库加载正确的值。 这可能是在 WordPress 主要版本更新之一期间发生的。
有关如何将管理面板重新连接到实际选项值(存储在 wp_option 中)的任何想法? 也许这是由于 WordPress 核心的行为变化而发生的,而主题并未反映出来。
We have installed this theme http://www.freshthemes.com/demo/weekly/ with WordPress 3.1.3.
When saving theme options the options are saved in the frontend, but not pushed through to the database.
On the front end, one can clearly see that the theme is still loading the correct values from the database.
That might have happened during one of the WordPress main version updates.
Any ideas about how to reconnect the admin panel to the actual option values (stored in wp_option)?
Maybe this happened due to a behaviour change in the WordPress core which is not reflected by the theme.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是解决方案:
http://wordpress.org/support/topic/get_theme_mod-seems-not-returning-any-value-after-upgrading-tp-wordpress-31
更多:
如果您丢失了主题选项,只需查看表 wp_options 并在 option_name 上搜索 LIKE '%theme_mods_%'
在我们的案例中,名称更改如下:
旧:theme_mods_weekly_v103
新:theme_mods_Weekly
要恢复旧设置,请将 option_value 复制到新的 option_name
Here is the solution:
http://wordpress.org/support/topic/get_theme_mod-seems-not-returning-any-value-after-upgrading-tp-wordpress-31
More:
If your lost your theme options just have a look in the table wp_options and search for LIKE '%theme_mods_%' on option_name
In our case names changes like that:
OLD: theme_mods_weekly_v103
NEW: theme_mods_Weekly
To restore the old settings copy the option_value to the new option_name