Calling widget via function in themes files (hard code)
Using the_widget() is the correct way to “hard code” an arbitrary Widget in a template file: <?php the_widget( ‘foobar_widget’, $instance, $args ); ?> Since the_widget() simply returns if ‘foobar_widget’ is not a registered Widget, it is functionally equivalent to using an if ( function_exists( $function ) ) conditional. You could look in core to see … Read more