Use WP_Query instead of custom select