Hi, I added some custom Liquid code to my Shopify theme to display a dynamic banner on collection pages. Since then, I’m seeing the error “Liquid syntax error (line 45): Unexpected character” and my banner is not rendering. I tried reverting that section but the error still shows. Does anyone know if this could be related to cached theme files or a missing variable in the snippet?
I can see there are lot of issues with your current code. But it’s important that you need to share the whole code of collection.liquid file so that I can provide you the fixed version of the code.
Thanks
Hi - Have you used AI to generate this code, I think if you go to line 45 you will find a comment with an illegal character. Ask your AI to fix it for you maybe?
There should exist a highlighted part in line 45 of this issue related liquid file. Go to check and find it, then correct the wrong characters and this issue shall be done.