I’ve created a custom popup for my client. The popup was working perfectly in Crave theme, but now that I have transferred the files into Prestige theme, the popup is not displaying at all, no matter what I try.
The website is farm2fire.com using prestige theme. All files are live
An affiliate link for popup is
Farm 2 Fire
and should show popup.
In the Chrome developer tools, the modal has an inline styling for display:block and is working properly, but not showing as a fixed position above all the main content.
You can see all the files in Chrome Developer Tools.
A little more context:
I used 3 different files to make the popup.
-
Theme.liquid – popup HTML within body tag
-
Popup.css – linked in the head section of theme.liquid file
{{ ‘popup.css’ | asset_url | stylesheet_tag: preload: true -}} above the theme.css asset link -
Popup.js – linked in the head section of theme.liquid file
The popup is displayed only if the document.location.href matches an affiliate link. In popup.js, I have an array of objects that store the affiliate links for partner resorts. If the resort.affiliateURL == document.location.href, then I run a function called enableModalFn(), that changes the CSS for modal-wrapper from none to block to display the popup in theme.liquid.
In theme.liquid, I have tried moving the popup HTML:
- above/below/within the main tag
- directly below the body tag
- last element in the body tag and outside of the main tag
- pasted the HTML popup including linking the css and script tag within a section tag and rendering in theme.liquid
- I’ve tried a snippet tag too and no luck.
Thanks for the help!