how to use a sidebar widget with its options in a template

enter image description here

I know that the title of this question is a litle confusing, but this the problem

I have recently installed a widget called Youtube Channel Gallery, which displays the latest videos on my website.

In the Appearance / Customize, I can easily embed the widget in the sidebar and specify all the necessary options.

But when using a custom template it’s a problem because I have to manually instanciate the widget using the class name and giving all options in a array.

$config = array(
    'title'=>'',
    // too many options
);

the_widget( 'YoutubeChannelGallery_Widget' );

The widget in the template is not showing correctly as there are a lot of options used by the plugin, which are hard to find in the function form().

I would like to know if there is a way to get the options of the widget in the sidebar so that I can direclty use them it in the template.

The only thing I can think of is the database, but I don’t in which tables I have to search.

Read more here:: how to use a sidebar widget with its options in a template

Leave a Reply

Your email address will not be published. Required fields are marked *