marionnorton Posted February 4 Share Posted February 4 I am trying to remove the header and footer from the search page. Because the search page is generated by Squarespace I cannot go into the page settings and remove the header/footer with code injection. Also, there is no collection to target in css. I have tried .sqs-search-page {header {display:none!important;} in CSS, but it did not work. Any help would be appreciated. Link to comment
Solution tuanphan Posted February 5 Solution Share Posted February 5 First, you need to add this to Website > Website Tools > Code Injection > Footer (do not add to Custom CSS) <script> if (document.location.pathname.indexOf("/search") == 0) { document.querySelector('body').classList.add('t-search') } </script> Next, add this code to Custom CSS box body.t-search { header#header, footer.sections {display: none !important;} } Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message Contact Customer Care - Learn CSS - Buy me a coffee (thank you!) Link to comment
marionnorton Posted February 6 Author Share Posted February 6 Thank you for your help. Worked great! Link to comment
K4NDY Posted August 7 Share Posted August 7 I would like to do this but for the shopping cart page? Link to comment
tuanphan Posted August 10 Share Posted August 10 On 8/7/2024 at 9:28 PM, K4NDY said: I would like to do this but for the shopping cart page? Cart page will be easier. Use this CSS code body#cart { header#header, footer.sections {display: none !important;} } Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message Contact Customer Care - Learn CSS - Buy me a coffee (thank you!) 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