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 Greeting, it's BeyondSpace, I am Squarespace dev focus on provide solutions to enhance feature that squarespace.com can't provide.Feel free to check my current Squarespace Plugins Developement: Enable Pinch/Zoom on lightbox, Delivery Date Picker, Lightbox Studio pluginIf you find my answer fit your need, 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
Create an account or sign in to comment
You need to be a member in order to leave a comment