redux 框架 opt_text 不显示值

redux framework opt_text not display the value

我厌倦了解决这个问题 我对 redux 框架选项有疑问 选项-init.php

    Redux::setSection( $opt_name, array(
    'title'  => __( 'Basic Field', 'redux-framework-demo' ),
    'id'     => 'basic',
    'desc'   => __( 'Basic field with no subsections.', 'redux-framework-demo' ),
    'icon'   => 'el el-home',
    'fields' => array(
        array(
            'id'       => 'opt-text',
            'type'     => 'text',
            'title'    => __('Text Option - Email Validated', 'redux-framework-demo'),
            'subtitle' => __('This is a little space under the Field Title in the Options table, additional info is good in here.', 'redux-framework-demo'),
            'desc'     => __('This is the description field, again good for additional info.', 'redux-framework-demo'),
            'validate' => 'email',
            'msg'      => 'custom error message',
            'default'  => 'test@test.com'
        )
    )
) );

这是我的index.php

<h1><?php global $opt_name; echo 'Text value: ' . $opt_name['opt-text']; ?></h1>

我收到这个错误 警告:C:\xampp\htdocs\wordpress\wp-content\themes\ZoXX\index.php 中第 2

中的非法字符串偏移量 'opt-text'

Redux 尚未加载。延迟您对变量的使用,或 运行:

Redux::init('OPT_NAME')

祝你好运!