Minor: should use `get_query_var()` instead of working directly with the global `$wp_query`