public static function wp_query_has_posts() { global $wp_query; return $wp_query && property_exists($wp_query, 'posts') && $wp_query->posts; }