Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
Hi There,
I have embedded a pop up form code onto my website for newsletter signups however, it is appearing on every single page which is annoying. How do I make it so that the pop up only appears on the homepage? I am using the Trade theme and my store link is https://manimagicnailbar.co.za
I've gone into my theme's code an don't see a CSS file anywhere so not sure what to do.
Please help
Thanks
Laila
Solved! Go to the solution
This is an accepted solution.
Hello @lailas26, If you have put a code into your snippet or section liquid file then put the condition on it like below.
{% if template == "index" %}
<!-- your embedded code -->
{% endif %}
and if you want to add it from the other resources like a third-party widget then do the CSS changes or else you have to get support for that third-party widget. Do the CSS changes like below. We can make a snippet of CSS or put this CSS in the "theme.liquid" file.
{% if template == "index" %}
<style>
div#popup-jTg95HqKNrDOnQsXN3rv-overlay{
display: flex;
}
</style>
{% else %}
<style>
div#popup-jTg95HqKNrDOnQsXN3rv-overlay{
display: none;
}
</style>
{% endif %}
If I managed to help you then, don't forget to Like it and Mark it as a Solution!
Best Regards,
Darshan Prajapati
This is an accepted solution.
Hello @lailas26, If you have put a code into your snippet or section liquid file then put the condition on it like below.
{% if template == "index" %}
<!-- your embedded code -->
{% endif %}
and if you want to add it from the other resources like a third-party widget then do the CSS changes or else you have to get support for that third-party widget. Do the CSS changes like below. We can make a snippet of CSS or put this CSS in the "theme.liquid" file.
{% if template == "index" %}
<style>
div#popup-jTg95HqKNrDOnQsXN3rv-overlay{
display: flex;
}
</style>
{% else %}
<style>
div#popup-jTg95HqKNrDOnQsXN3rv-overlay{
display: none;
}
</style>
{% endif %}
If I managed to help you then, don't forget to Like it and Mark it as a Solution!
Best Regards,
Darshan Prajapati
Thank you so much! This seems to have done the trick!
@lailas26 You are most welcome 😊. If anything is required further or still having any doubt then surely you can contact me.
Best Regards,
Darshan Prajapati
Starting a B2B store is a big undertaking that requires careful planning and execution. W...
By JasonH Sep 23, 2024By 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, 2024