【问题标题】:Multiple Elementor "Group_Control_Background" control label is not workingMultiple Elementor \"Group_Control_Background\" 控制标签不起作用
【发布时间】:2022-08-04 00:44:45
【问题描述】:

我需要对 Elementor 自定义小部件进行 3 个背景组控制。所以,我正在使用这个:

$this->add_group_control(
    \\Elementor\\Group_Control_Background::get_type(),
    [
        \'name\' => \'background_active\',
        \'label\' => esc_html__( \'Background Active\', \'plugin-name\' ),
        \'types\' => [ \'classic\', \'gradient\', \'video\' ],
        \'selector\' => \'{{WRAPPER}} .navigate-master ul li a.active\',
        \'default\' => esc_html__( \'#ffb200\' , \'plugin-name\' ),
        \'condition\' => [
            \'nm_nm_title\' => \'\',
        ],
    ]
);

$this->add_group_control(
    \\Elementor\\Group_Control_Background::get_type(),
    [
        \'name\' => \'background\',
        \'label\' => esc_html__( \'Background\', \'plugin-name\' ),
        \'types\' => [ \'classic\', \'gradient\', \'video\' ],
        \'selector\' => \'{{WRAPPER}} .navigate-master ul li a\',
        \'default\' => esc_html__( \'#ffb200\' , \'plugin-name\' ),
        \'condition\' => [
            \'nm_nm_title\' => \'\',
        ],
    ]
);

$this->add_group_control(
    \\Elementor\\Group_Control_Background::get_type(),
    [
        \'name\' => \'background_hover\',
        \'label\' => esc_html__( \'Background Hover\', \'plugin-name\' ),
        \'types\' => [ \'classic\', \'gradient\', \'video\' ],
        \'selector\' => \'{{WRAPPER}} .navigate-master ul li a:hover\',
        \'default\' => esc_html__( \'yellow\' , \'plugin-name\' ),
        \'condition\' => [
            \'nm_nm_title\' => \'\',
        ],
    ]
);

您可以看到我使用了唯一的名称和标签,但在小部件侧边栏上看不到不同的标签。

你能告诉我为什么吗?

    标签: elementor


    【解决方案1】:

    您正在使用 Group_Control_Background。而且这个控件也不支持自定义标签。在这种情况下,请创建具有 3 个区域的选项卡,然后将它们包含在单独的区域中。

    【讨论】:

      猜你喜欢
      • 2021-06-02
      • 2020-08-05
      • 1970-01-01
      • 2022-01-20
      • 2017-01-13
      • 1970-01-01
      • 1970-01-01
      • 2021-09-16
      • 2015-03-24
      相关资源
      最近更新 更多