Moves recent posts published post logic from template to view