【发布时间】:2022-01-10 02:25:25
【问题描述】:
我想为我的自定义主题创建一个选项,用户可以更改主题颜色(如导航背景)。 我想从数据库中获取一些数据,如颜色代码(#000),然后在 style.php 文件中使用。之后将其作为 css 文件包含在 wp_head 中。 问题是当我使用这段代码时:
wp_enqueue_style('style.php.css', '/functions/style.php');
我得到这个错误:
Uncaught Error: Call to undefined function theme_get_option() in D:\xampp\htdocs\theme\wp-content\themes\theme\functions\style.php:6
感谢帮助
【问题讨论】: