Home>Support>Getting started with custom widget

Getting started with custom widget

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!

This is our free support forum. Replies can take several days. If you need fast email support, please purchase a SiteOrigin Premium license.

  1. 8 years, 9 months ago Alex S
    Hi, I Work Here

    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.

Get The Most Out of SiteOrigin with SiteOrigin Premium

Find Out More