Shopify themes, liquid, logos, and UX
Hello,
I would like to make the navigation menu on mobile show up only on my product/collection pages and noton front page or any other pages like contact.
Is there a way to achieve this?
Is there a code to hide mobile navigation menu from certain pages?
My website is https://taketwojewelry.com/
Thank you.
Hi @TimTakeTwo
You can try to use media query to display the content on mobile view, and you can use the template object to only display the menu on the product or collection page.
For example:
<section>
// Your another elements
{% if temeplate.name == 'product' or template.name == 'collection' %}
<nav id="secondary-menu">
// Your menu code
</nav>
{% endif %}
</section>
<style>
@media screen and (max-width: 750px) {
#secondary-menu { display: block; }
}
@media screen and (min-width: 1280px) {
#secondary-menu { display: none; }
}
</style>
Hopefully can answer your question 🙂
Hello,
Thank you for getting back to me. Where would I add this code section to?
Thank you.
By investing 30 minutes of your time, you can unlock the potential for increased sales,...
By Jacqui Sep 11, 2024We appreciate the diverse ways you participate in and engage with the Shopify Communi...
By JasonH Sep 9, 2024Thanks to everyone who participated in our AMA with 2H Media: Marketing Your Shopify St...
By Jacqui Sep 6, 2024