Code works on preview, but not on live site preview

Hi Andrew, modifying the code to call the function for each item individually fixed it. I’m still baffled on why it worked on the preview and not the live, though.