How not to display an instance of a widget dynamically?
The description of your problem is very minimal but the obvious solution is simply to output widget data only when the query is not empty: class cond_widget extends WP_Widget { public function __construct() { // widget actual processes parent::__construct( ‘test’, // Base ID ‘test’, // Name array( ‘description’ => __( ‘test’, ‘foo’)) ); } public … Read more