我不知道我怎么了。我只是简单地使用 build.reduxframework.com 生成了一个文件,然后添加到我的 Wordpress 主题中。然后将以下行添加到functions.php
if(is_admin()){
require_once(get_template_directory().'/core/admin/admin-init.php');
}
好消息是演示的东西出现了。现在我的 $opt_name 是 for_test。在我的 header.php 中,我添加了以下代码。
<h2><?php
global $for_test;
echo $for_test['textarea-example'];
?></h2>
PS:textarea-example 是我下载的文件中已经添加的字段的 id。但我不知道为什么它没有获取其中的价值。