Question:
How would one add Custom Code for dynamic pages created from CMS?
Product:
Wix Editor
What are you trying to achieve:
I would like to add custom CSS to headers of dynamic pages (for specificity, I’ll refer to them as My-Dynamic Page) via Wix Settings > Custom Code.
Just to be clear, my site has a home page, a store page and a My-Dynamic Page(s), which maps out a CMS collection of categories into separate pages. I am trying to add custom CSS only to all of these My-Dynamic Pages.
What have you already tried:
Under Wix Settings > Custom Code, I have tried selecting the option to apply code only to My-Dynamic Page. However, this doesn’t work on my Live site and when inspecting the page HTML, the custom code has not been added to the <head>, where I have specified.
In comparison, I have added a different custom CSS code for my store page (and only my store page) and the CSS does appear in my store page’s HTML <head>.
If I set the custom code to be applied to All pages, the custom CSS then appears on my My-Dynamic Pages. Sadly, this won’t work for me as I cannot have this particular custom CSS affect my other pages, as they use similar elements.
More frustratingly, if I set this custom CSS to apply to My-Dynamic Pages as well as another static page, say my Home page, the custom CSS is only applied to my Home page, where I do not want it.
Additional information:
This issue is regardless of what code I put in. I could declare that my custom CSS code be an empty <style></style>, it still does get added into the HTML <head> if set to All pages, just not if it is set only to apply on My-Dynamic Pages.