This thread is over two years old and may be outdated. Please create a new thread if you need help, or email us if you have an active Premium license.

Getting started with custom widget

9 years ago · Last reply by Alex S 9 years ago

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!

This is our free support forum. Replies can take several days.

Need fast email support? Get SiteOrigin Premium

Replies

1
  1. Alex S Staff 9 years, 4 months ago

    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.

Replies on this thread are closed.

Please create a new thread if you have a question, or purchase a SiteOrigin Premium license if you need one-on-one email support.

Have a different question or issue?

Start New Thread