Sohel Arman
Sohel Arman

Reputation: 3

I ma trying to use Elementor Typography Control. But It's not working

Right now I am using This For Elementor Control. I tried almost 10 times but it is not working. Somebody please help me. I didn't figure out why it's not working. Other Controls are working fine. The are all set. Only the Typography Controls not working.


        //slide control
        $this->start_controls_section(
            'hero_area_section',
            [
                'label' => __( 'Content', 'plugin-name' ),
                'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
            ]
        );

$this->add_control(
        'bg', [
            'label' => __( 'Background', 'plugin-domain' ),
            'type' => \Elementor\Controls_Manager::MEDIA,
            'label_block' => true,
        ]
    );
  $this->add_control(
        'title', [
            'label' => __( 'Title', 'plugin-domain' ),
            'type' => \Elementor\Controls_Manager::TEXTAREA,
            'label_block' => true,
        ]
    );
   $this->add_control(
        'cap', [
            'label' => __( 'Caption', 'plugin-domain' ),
            'type' => \Elementor\Controls_Manager::TEXTAREA,
            'label_block' => true,
        ]
    );

  $this->add_group_control(
    Group_Control_Typography::get_type(),
    [
        'name' => 'title_typography',
        'label' => __( 'Title Typography', 'my-plugin-domain' ),
        'scheme' => Scheme_Typography::TYPOGRAPHY_1,
        'selector' => '{{WRAPPER}} h3',

    ]
);

$this->end_controls_section();```



And this is not working and showing this Erro:

**Fatal error: Uncaught Error: Class 'Group_Control_Typography' not found in C:\xampp\htdocs\kaye\wp-content\plugins\toolkit\widgets\hero_area.php:66 Stack trace: #0 C:\xampp\htdocs\kaye\wp-content\plugins\elementor\includes\base\controls-stack.php(1900): rrfCommercew_hero_area->_register_controls() #1 C:\xampp\htdocs\kaye\wp-content\plugins\elementor\includes\base\controls-stack.php(487): Elementor\Controls_Stack->init_controls() #2 C:\xampp\htdocs\kaye\wp-content\plugins\elementor\includes\base\widget-base.php(148): Elementor\Controls_Stack->get_stack() #3 C:\xampp\htdocs\kaye\wp-content\plugins\elementor\includes\base\controls-stack.php(280): Elementor\Widget_Base->get_stack() #4 C:\xampp\htdocs\kaye\wp-content\plugins\elementor\includes\base\controls-stack.php(1935): Elementor\Controls_Stack->get_controls() #5 C:\xampp\htdocs\kaye\wp-content\plugins\elementor\includes\base\controls-stack.php(1022): Elementor\Controls_Stack->sanitize_settings(Array) #6 C:\xampp\htdocs\kaye\wp-content\plugins\elementor\includes\base\eleme in C:\xampp\htdocs\kaye\wp-content\plugins\toolkit\widgets\hero_area.php on line 66**

Upvotes: 0

Views: 4468

Answers (4)

G.F.
G.F.

Reputation: 789

Scheme_Typography is deprecated. Use \Elementor\Core\Schemes\Typography instead

https://forum.elementor.com/development-24/deprecated-elementor-scheme-typography-solved-sure-9919

Upvotes: 0

san_techie
san_techie

Reputation: 11

Use like this,

        $this->add_group_control(
   \Elementor\Group_Control_Typography::get_type(),
     [
         'name' => 'content_typography',
     'selector' => '{{WRAPPER}} .santha_widget_layout',
    ]
);

Upvotes: 0

ripon
ripon

Reputation: 51

Before Group_Control_Typography use \Elementor\ like you did in the other sections.

Upvotes: 1

Robert Morel
Robert Morel

Reputation: 31

For me I needed to add the following at the top of the file:

use Elementor\Scheme_Typography;

I discovered this after turning on PHP error reporting.

Upvotes: 0

Related Questions