Hi Site Origin Team,
Firstly, thank you guys for this outstanding page builder, i absolutely love it!
I’m a bit of a newbie and am trying to follow the creating a widget tutorial, but i’m not able to get the hello world widget to show up with the other site origin widgets.
I’m sure i have the file structure of the widget down correct, but i’m not sure if i am placing this all in the correct place.
Where in the theme would i need to place the extra-widgets-bundle folder please? I’m following the tutorial here https://siteorigin.com/docs/widgets-bundle/getting-started/creating-a-widget/
Once i see the widget show up in the admin i can start tackling building an actual widget.
It’s quite possible i am missing a couple of concepts here, any guidance would be massively appreciated.
Many thanks in advance,
Paul
Hi Paulka
In this section of your code
Use this for your $folders setting
Replace with the name of your widget folder. You can then upload your widget folder directly to the wp-content/plugins directory.
Let us know how you get on and good luck with your widget.
Magus
Hey Magus,
Thank you for the rapid reply!
Unfortunately the solution did not work for me, i fear i am being a numpty here so i’m going to label out exactly what i’ve done so we can be sure.
1. Inside of the plugins directory i have created a folder called: extend-widgets-bundle
2. Inside the extend-widgets-bundle folder i have created a folder called: extra-widgets and file called extend-widgets-bundle.php.
3. Inside the extend-widgets-bundle.php file there is the following code:
4. Inside the extra-widgets folder there is a folder called: hello-world-widget
5. Inside the hello-world-widget folder the is a folder called hw-templates and a file called: hello-world-widget.php
6. Inside the hello-world-widget.php file there is the following code:
7. Inside the hw-templates folder there is a file called hello-world-template.php which contains the following code:
As i said i am a bit of a newbie, apologies in advance and thank you for your time.
Best,
Paul
Hi Paul
Please change this line
to this
The folders path needs to be pointing to the folder containing the widgets themselves rather than the main containing folder.
Let us know how you get on
Magus
sorry read that last as
Magus
Unfortunately, still no joy?
Hi Paul
Please add this to the top of your extend-widgets-bundle.php after the opening php tag
Magus
Hey Magus,
Ok great, that has made this show up in the plugins admin, i activated it and then the widget showed up with the other widgets. Problem now is, once the widget is turned on a few errors appear.
Missing argument 1 for SiteOrigin_Widget::__construct(), called in /var/sites/s/services.mydev.click/public_html/wp-includes/widgets.php on line 560 and defined in /var/sites/s/services.mydev.click/public_html/wp-content/plugins/so-widgets-bundle/base/siteorigin-widget.class.php on line 47
Cannot modify header information – headers already sent by (output started at /var/sites/s/services.mydev.click/public_html/wp-content/plugins/so-widgets-bundle/base/siteorigin-widget.class.php:47) in /var/sites/s/services.mydev.click/public_html/wp-includes/option.php on line 772
Cannot modify header information – headers already sent by (output started at /var/sites/s/services.mydev.click/public_html/wp-content/plugins/so-widgets-bundle/base/siteorigin-widget.class.php:47) in /var/sites/s/services.mydev.click/public_html/wp-includes/option.php on line 773
If this is blatantly obvious to you whats wrong, please let me know, otherwise there is no need to spend a heap time trying to solve this. I will look into it and try to figure a few things out myself.
Many thanks again for your help on this.
All the best,
Paul
Hi Paul
Headers already sent errors are typically caused by spaces or new lines before the opening <?php tag Please check your pages for any unneeded empty lines at the top or bottom.
Magus
Hi Magus,
Thats great, i appreciate the time you have taken here to help out. Now to figure out the whole creating a widget thingy.
Thanks again,
Paul
Hi Paul
You are welcome.
Good luck with the widget and if you need any more help please don’t hesitate to open a new thread.
Magus