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
We recently spoke with Zopi developers @Zopi about how dropshipping businesses can enha...
By JasonH Oct 23, 2024A big shout out to all of the merchants who participated in our AMA with 2H Media: Holi...
By Jacqui Oct 21, 2024We want to take a moment to celebrate the incredible ways you all engage with the Shopi...
By JasonH Oct 15, 2024