Get all posts PHP function