1
votes

I using Elementor via Press Elements on WordPress to make my custom theme dynamic with making widget, It's my first time, I successed somehow, but there is a small problem, my widget not list in widget lists, but it find when I search via search bar, but I want to show in list by default, like the others.

I followed this steps to create widget, what I missed?

  1. Create my php file for widget
  2. assaign to press-elements.php

code:

    private function register_widgets()
    {
        \Elementor\Plugin::instance()->widgets_manager->register_widget_type( new \PressElements\Widgets\Members() );
    }

and:

    private function include_widgets()
    {
    require_once __DIR__ . '/widgets/Members.php';
}

That's all

This is list:

enter image description here

And when I search:

enter image description here

1
Did you define get_categories ? if true, share it. - Pedram
@Pedram yes, public function get_categories() { return [ 'pmc-widget' ]; } - tour travel

1 Answers

1
votes

Sounds to me look like you forget to register category in press-elements.php, search for add_elementor_category() function, add this line:

->add_category( 'pmc-widget', ['title' =>'PMC Widget',]

By this, all widgets under pmc-widget title, will be group in your list.