Notice: This thread is over two years old; the information may be outdated. Please consider creating a new thread if you require free support. If you have an active SiteOrigin Premium license, you can email our premium support desk at [email protected].
Hello, I am following your Creating a widget tutorial. To create a widget it is needed to input the following code into some file.
<?php function add_my_awesome_widgets_collection($folders){ $folders[] = 'path/to/my/widgets/'; return $folders; } add_filter('siteorigin_widgets_widget_folders', 'add_my_awesome_widgets_collection');
Which is the file to put the code is not mentioned, so I’m not sure.
For a case, here is my file tree for SiteOrigin Widget Bundle folder
Where to put the code exactly?
Thanks in advance!
Hi Stenk,
You’ll need to place the code in your theme or plugin. The latter being the recommended option. For information on how to create a plugin, please refer to this page for a basic guide on creating a plugin.