fix map global and use pre_get_posts for main query