Hello,
I wanted to add a custom widget to the PageBuilder and found this tutorial:
https://siteorigin.com/docs/widgets-bundle/getting-started/creating-a-widget/
I followed the instructions, but i don’t know what you mean with
Once you’ve done this, you’ll see your widget in the Plugins > SiteOrigin Widgets list, it can be activated and deactivated
My Steps:
I created a Folder ‘pagebuilder’ in my theme directory’
I created a Folder ‘icon-row-widget’ in the pagebuilder folder
I created the file ‘icon-row-widget.php’ in “pagebulder/icon-row-widget”
Code from icon-row-widget.php:
<?php /* Widget Name: Icon Row Description: An example widget which displays 'Hello world!'. Author: Me Author URI: http://example.com Widget URI: http://example.com/hello-world-widget-docs, Video URI: http://example.com/hello-world-widget-video */ class Icon_Row_Widget extends SiteOrigin_Widget { function get_template_name($instance) { return ''; } function get_style_name($instance) { return ''; } } siteorigin_widget_register("icon-row-widget", __FILE__, "Icon_Row_Widget");
Function.php
function wbexample_add_widget_folders($folders){ $folders[] = get_template_directory() . '/pagebuilder/'; return $folders; } add_filter('siteorigin_widgets_widget_folders', 'wbexample_add_widget_folders');
Hi Mathis,
Okay so the issue here is that siteorigin_widgets_widget_folders is used to tell SiteOrigin Page Builder a directory that contains widgets, not a widget directory. This means that you need to give your custom widget a directory inside the pagebuilder directory. For example, here’s an image of the correct directory structure: