Use empty() instead of is_null() when checking $wp_query to cover more possible edge cases