Jump to content

Add custom code to a specific product page

Go to solution Solved by Lesum,

Recommended Posts

Posted

Site URL: https://www.blueprintsportsguides.com

Hi,

I’m looking to theme the below page:

https://www.blueprintsportsguides.com/purchase/p/football


to match the theme of this page (by theme I’m referring to custom header colour, logo and section background colours):

https://www.blueprintsportsguides.com/football
 

If I had access to the page header code injection, I could easily make these changes using the pre-existing code from the above page (and just changing the section ID for the background colour). However, because this option is not available on a specific product page, I’m wondering how it can be done?

I don’t want all product pages to be themed like this (eventually when we add the other products they will have there own header logo and page colours respectively).

Any help much appreciated. Thank you! 

  • Solution
Posted

Hi @bluethebear, You can add this code under Website > Pages > Website Tools > Custom CSS to change the header color, logo, and section background color on the product page you mentioned. For other product pages, simply copy and paste this block of code and replace the page ID with the corresponding product page's ID.

#item-66aa9ac6ddc7683266f87a82 {
    #header .header-announcement-bar-wrapper .header-background-solid {
        background-color: #c5ffb6 !important;
    }
    .header-title-logo img {
        content: url('https://images.squarespace-cdn.com/content/65099cf8baecb06e881ee700/e3062e60-1d6d-499a-89bf-5c0b3da1f221/BluePrint+Football.png?content-type=image%2Fpng') !important;
        max-height: 71px !important;
    }
    #page .page-section .section-background {
        background-color: #e7ffe7 !important;
    }
}

 

If my comments were useful, please like or mark my solution as answer so others can scroll to it quickly. 

Sam
Web Developer & Digital Designer

 Did you find my contribution helpful? Buy me a coffee?

Posted
15 hours ago, Lesum said:

Hi @bluethebear, You can add this code under Website > Pages > Website Tools > Custom CSS to change the header color, logo, and section background color on the product page you mentioned. For other product pages, simply copy and paste this block of code and replace the page ID with the corresponding product page's ID.

#item-66aa9ac6ddc7683266f87a82 {
    #header .header-announcement-bar-wrapper .header-background-solid {
        background-color: #c5ffb6 !important;
    }
    .header-title-logo img {
        content: url('https://images.squarespace-cdn.com/content/65099cf8baecb06e881ee700/e3062e60-1d6d-499a-89bf-5c0b3da1f221/BluePrint+Football.png?content-type=image%2Fpng') !important;
        max-height: 71px !important;
    }
    #page .page-section .section-background {
        background-color: #e7ffe7 !important;
    }
}

 

Amazing, thank you!

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.