Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
Hey!
This is my site: /https://naahal.mx/
I'm using a paid theme, the problem is that on mobile version, the lateral menu and the filter and sort buttons doesn't seem to do anything. I've tried everything and still doesn't work, they only work the first time you enter the site and then they are dead.
Hi @Naahal ,
I have gone through your site and on inspecting it seems that there is a "jQuery" conflict. So make sure you have defined the jQuery correctly. So please make sure of the below things:
1. Include jQuery in Your Theme:
First, ensure that jQuery is included in your Shopify theme. Most Shopify themes include jQuery by default, but if it is missing, you can add it manually.
2. To add jQuery to Your Theme:
Go to Online Store > Themes in your Shopify admin panel.
Click on Actions > Edit code for the theme you are using.
Open the layout/theme.liquid file.
Add the following script tag inside the <head> tag:
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
Make sure this script tag is before any other scripts that depend on jQuery.
3. Check the Order of Script Loading:
Ensure your custom scripts are loaded after jQuery. You can do this by placing your custom script tags after the jQuery script tag in the theme.liquid file or any other relevant file where you include scripts.
4. Using Asset Files:
If you prefer to use asset files, you can upload jQuery to your assets and include it in your theme:
Go to Online Store > Themes > Actions > Edit code.
Under the Assets folder, click Add a new asset and upload the jQuery file.
Include the uploaded jQuery file in your theme.liquid file or any other relevant template files by adding the following line:
{{ 'jquery-3.6.0.min.js' | asset_url | script_tag }}
5.Check for Other Conflicts:
If you are still facing issues, ensure there are no other scripts or libraries that might be conflicting with jQuery. Check the browser console for any other errors that might give you more context.
I hope this helps! If it does, please like it and mark it as a solution!
If you need further assistance, feel free to reach out!
Regards,
Sweans
Thanks to everyone who participated in our AMA with 2H Media: Marketing Your Shopify St...
By Jacqui Sep 6, 2024The Hydrogen Visual Editor is now available to merchants in Shopify Editions | Summer '...
By JasonH Sep 2, 2024Note: Customizing your CSS requires some familiarity with CSS and HTML. Before you cust...
By JasonH Aug 12, 2024