The function the_widget()
does not return any output it only echo
s it. If you want to save its output to a variable you need to use output buffering.
ob_start();
the_widget('My_Custom_Widget');
$w = ob_get_contents();
ob_end_clean();
The function the_widget()
does not return any output it only echo
s it. If you want to save its output to a variable you need to use output buffering.
ob_start();
the_widget('My_Custom_Widget');
$w = ob_get_contents();
ob_end_clean();