Javascript “我该如何解决?”;未捕获的语法错误:意外标记<&引用;WordPress/Genesis框架出错?

Javascript “我该如何解决?”;未捕获的语法错误:意外标记<&引用;WordPress/Genesis框架出错?,javascript,wordpress,syntax-error,custom-wordpress-pages,genesis,Javascript,Wordpress,Syntax Error,Custom Wordpress Pages,Genesis,我正在创建我的第一个WordPress Genesis儿童主题。我试图使用get\u theme\u mod()函数从我在WordPress后端创建的两个自定义控件返回两个值。在functions.php中,我有以下内容: $wp_customize->add_setting( 'gs_custom_theme_setting_background_image_1', array( 'default' => '',

我正在创建我的第一个WordPress Genesis儿童主题。我试图使用
get\u theme\u mod()
函数从我在WordPress后端创建的两个自定义控件返回两个值。在
functions.php
中,我有以下内容:

$wp_customize->add_setting(
    'gs_custom_theme_setting_background_image_1',
        array(
            'default' => '',
            'sanitize_callback' => 'gs_custom_theme_sanitize_bgi',
        )
);

$wp_customize->add_control(
    new WP_Customize_Image_Control(
        $wp_customize, 'gs_custom_image_bg_setting_1', array(
            'label' =>  __( 'Background Image 1st', 'gs-custom-theme' ),
            'settings' => 'gs_custom_theme_setting_background_image_1',
            'section' => 'gs_custom_theme_front_section',
            'priority' => 20
        )
    )
);


$wp_customize->add_setting(
    'gs_custom_theme_setting_color_background_1',
        array(
            'default' => '#000000',
            'sanitize_callback' => 'sanitize_hex_color'
        )
);

$wp_customize->add_control(
    new WP_Customize_Color_Control(
        $wp_customize, 'gs_custom_theme_setting_color_background_1', array(
            'label' => __( 'Background Color 1', 'gs-custom-theme' ),
            'settings' => 'gs_custom_theme_setting_color_background_1',
            'section' => 'gs_custom_theme_front_section',
            'priority' => 15
        )
    )
);
这将使用主题自定义API(一个颜色选择器和一个图像选择器)创建两个自定义设置和两个自定义控件。我所要做的就是使用
front page.php中的以下命令,为我选择的任何颜色回显十六进制值,并为我在首页上选择的任何图像回显URL:

<?php echo get_theme_mod('gs_custom_theme_setting_color_background_1') ?>

<?php echo get_theme_mod('gs_custom_theme_setting_background_image_1') ?>

颜色选择器工作得非常好,可以显示我所选择的任何颜色的十六进制值。然而,当我尝试在后端使用图像选择器时,不仅没有图像URL显示在我的首页上,而且我得到了。我在这里和WordPress.org都看过了,这似乎是一个与javascript相关的问题,但我没有向我的网站添加任何javascript,也没有任何活动插件


有人知道从哪里开始查找这个神秘的语法错误吗?

将背景图像一改为:我从未使用过与设置id相同的控件id,但这可能就是为什么一个有效,另一个无效。控件id“gs\ U自定义\主题\设置\颜色\背景\ 1”与设置“gs\ U自定义\主题\设置\颜色\背景\ 1”相同。另外,我会使用Kirki()或-,这节省了很多麻烦。将背景图像更改为:并且我从未使用过与设置id相同的控件id,但这可能就是为什么一个有效,另一个无效的原因。控件id“gs\ U自定义\主题\设置\颜色\背景\ 1”与设置“gs\ U自定义\主题\设置\颜色\背景\ 1”相同。另外,我会使用Kirki()或-,这样可以省去很多痛苦。