Elementor – how to create your own custom post plugin

In this article you will learn how to add a custom post in Elementor through our plugin. In the previous guide: Creating your own plugin that adds a widget to the Elementor plugin we created a plugin that adds custom widgets to the Elementor plugin. Now we would like to create a widget for our plugin that would add posts of its own type, specified in the widget, and a field that we would also choose from Elementor. This will be the same solution as in REDO JSComposer Additional – plugin adding widget to WPBakery only instead of WPBakery the target plugin will be Elementor.

Elementor – how to create your own custom post plugin

Let’s start working on the widget.

We create another widget in the widgets folder and call it customPostRedo.php, which will store the CustomPostRedo.

Creating your own widget for Elementor.

We need to return to the root folder of our plugin and edit the main.php file. We need to point the path to our widget and its class in the main E_REDO. To do this we add the same way as in the projects widget. php – path in require_once() and add a path to CustomPostRedo in register_widgets().

All set. We are going to edit our customPostRedo.php