Liquid Code Error After Customizing Theme Sections

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?

Regards

Hey @AulLaep

Can you share a screenshot of line number 45 when you try to save the file?

Best,
Moeed

@AulLaep Thanks for posting here.

Can you please share the full file code here, or the error line code, and a screenshot?

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?

Derek

Hi @AulLaep ,
That error means there’s a typo in your Liquid — usually a stray {}, missing {% endif %}, or bad filter syntax.

Check around line 45 (and 2–3 lines before/after). If you used a snippet, comment out {% render 'your-banner' %} to confirm it’s the cause.

Please share those lines here if you want me to spot the exact issue.

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.