added wpposts helper for generic query loop