I'm setting some options in the backend using functions.php and I'm doing:
$w = the_widget('My_Custom_Widget');
but I don't get any output.
However doing
<?php the_widget('My_Custom_Widget'); ?>
on any page template works fine.
How can I do this?