JSDorais Posted June 9, 2020 Share Posted June 9, 2020 Site URL: https://www.twentyoneknots.com Good morning all, I have a piece of code that enables 'chat' functionality on our website. This code needs to be imbedded before the </head> tag. The code needs to be applied to the 'footer' section of every page (Settings -> Advanced -> Code Injection -> Footer). Question is, how can I exclude code from being injected on the home page (as I would like it on all my other pages)? Thank you. JS Link to comment
Beyondspace Posted June 15, 2020 Share Posted June 15, 2020 On 6/9/2020 at 8:22 PM, JSDorais said: Site URL: https://www.twentyoneknots.com Good morning all, I have a piece of code that enables 'chat' functionality on our website. This code needs to be imbedded before the </head> tag. The code needs to be applied to the 'footer' section of every page (Settings -> Advanced -> Code Injection -> Footer). Question is, how can I exclude code from being injected on the home page (as I would like it on all my other pages)? Thank you. JS Hi there The index page has a unique class name in body indicate it's role we may take advantage of that BeyondSpace - Squarespace Website Developer 🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox) 🗓️ Delivery Date Picker (Squarespace Date format) 💫 Animated Buttons (Referral URL) 🥳 Sparkplugin Customisations Browsers (Browse +100 Spark plugin customisations) 🥳 Elfsight Template Browsers (Browse +1000 Elfsight widget Templates) If you find my answer useful, let's leave a like or upvote so others with the same issue can find their solution. Thank you! Link to comment
RyanDejaegher Posted June 15, 2020 Share Posted June 15, 2020 @JSDorais you can add some code to your chatbox script that will load the script on everypage but the homepage. if(window.location.href === 'https://www.twentyoneknots.com/') { return } else { // Add code for your live chat script here } Philadelphia, PA 👉 Squarespace Tutorials Chat/Message on FB Messenger for quickest response: https://m.me/dejaegherryan Link to comment
Recommended Posts
Archived
This topic is now archived and is closed to further replies.