Jump to content

How to Change Logo Link in Top Navigation (Theme: Nolan)

Recommended Posts

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

I have created a cover page for my website:

https://www.nothingisnotnothing.com/

To do this I created a home page and removed the header and footer etc.

The cover page links through to the main site: 
https://www.nothingisnotnothing.com/home

However, when you click the logo on the main site it links back to the cover page - because it is set as the homepage.

I want the logo / site title in the top navigation to link back to the main site rather than the cover page.

Is there a code I can use to do this?

Thanks,

James

Link to comment
1 hour ago, JamesMoruzzi said:

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

I have created a cover page for my website:

https://www.nothingisnotnothing.com/

To do this I created a home page and removed the header and footer etc.

The cover page links through to the main site: 
https://www.nothingisnotnothing.com/home

However, when you click the logo on the main site it links back to the cover page - because it is set as the homepage.

I want the logo / site title in the top navigation to link back to the main site rather than the cover page.

Is there a code I can use to do this?

Thanks,

James

What is the url slug of the cover page?

image.thumb.png.517942217bc4f8e788e9b411d79d31ca.png

BeyondSpace - Squarespace Website Developer

🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox)
🗓️ Delivery Date Picker (Squarespace Date picker form field)
💫 Gallery block 7.1 workaround
🥳 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

This is the cover page URL:
https://www.nothingisnotnothing.com/hello

The cover page will also load with this as it's set to homepage https://www.nothingisnotnothing.com/

 

Note:

I moved the domain over to this site yesterday, so you might see incorrect visuals for the next 48 hours. The cover page has a big logo on a dark blue back ground. Thought you might get confused by what you were seeing..!

Link to comment

@bangank36

This is the cover page URL:
https://www.nothingisnotnothing.com/hello

The cover page will also load with this as it's set to homepage https://www.nothingisnotnothing.com/

Note:

I moved the domain over to this site yesterday, so you might see incorrect visuals for the next 48 hours. The cover page has a big logo on a dark blue back ground. Thought you might get confused by what you were seeing..!

Link to comment

Try adding to Home > Settings > Advanced > Code Injection

<script>
    (function() {
        window.addEventListener('DOMContentLoaded', () => {
          document.querySelector('.header-title-logo > a').setAttribute('href', '/home');
        });
    })()
</script>

Let me know how it works on your site

Support me by pressing 👍 if this useful for you

BeyondSpace - Squarespace Website Developer

🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox)
🗓️ Delivery Date Picker (Squarespace Date picker form field)
💫 Gallery block 7.1 workaround
🥳 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
  • 5 months later...

Hey, this code:

<script>
    (function() {
        window.addEventListener('DOMContentLoaded', () => {
          document.querySelector('.header-title-logo > a').setAttribute('href', '/home');
        });
    })()
</script>

worked for me on desktop but when I test it on mobile it still links back to the cover page, is there a fix for this? 

Link to comment

Site URL: https://halibut-porcupine-m9fs.squarespace.com/

Site URL: https://halibut-porcupine-m9fs.squarespace.com/

Password: halibut

I have created a cover page for my website which I've set as the homepage. 

To do this I created a home page and removed the header and footer etc.

The cover page links through to the main site: 

https://halibut-porcupine-m9fs.squarespace.com/home

Originally when you click the logo on the main site it links back to the cover page - because it is set as the homepage.

This bit of code has solved this on the desktop site but not on mobile. Can anyone help me change it on mobile as well?

<script>
    (function() {
        window.addEventListener('DOMContentLoaded', () => {
          document.querySelector('.header-title-logo > a').setAttribute('href', '/home');
        });
    })()
</script>

Thanks,

Tara

Link to comment
31 minutes ago, Red_Dot_Design said:

I have created a cover page for my website which I've set as the homepage. Originally when you click the logo on the main site it links back to the cover page - because it is set as the homepage.

Code has solved this on the desktop site but not on mobile. Can anyone help me change it on mobile as well?

@Red_Dot_Design Before I answer your specific question, I feel it only right to explain that your content warning on the homepage may not be seen by visitors to the site.

This is because, once the site is live, users may arrive on the website from search results that take them to other pages on the site (like this link), bypassing the homepage completely.

I just wanted to let you know in case you weren't aware 🙂

image.thumb.png.6c7839ea60e33a2be0659f62f21dae69.png

To answer your question, the desktop and mobile versions of the site have separate site logos with separate settings. The code that you've reposted identifies the first one (desktop) and skips the second one (mobile). To change the link on the mobile version of the logo, you'll also need to add this:

document.querySelector('.header-display-mobile .header-title .header-title-logo > a').setAttribute('href', '/home');

Add it after the first version so that it looks something like this:

<script>
  (function() { 
    window.addEventListener('DOMContentLoaded', () => { 
      document.querySelector('.header-title-logo > a').setAttribute('href', '/home');
      document.querySelector('.header-display-mobile .header-title .header-title-logo > a').setAttribute('href', '/home');      
    });
  })() 
</script>

 

Edited by paul2009
edited for clarity

About me: I've been a SQSP User for 18 yrs. I was invited to join the Circle when it launched in 2016. I have been a Circle Leader since 2017. I don't work for Squarespace. I value honesty, transparency, diversity and good design ♥.
Work: I founded and run SF.DIGITAL, building Squarespace Extensions to supercharge your commerce website. 
Content: Views and opinions are my own. Links in my posts may refer to SF.DIGITAL products or may be affiliate links.
Forum advice is free. You can thank me by clicking one of the feedback emojis below. Coffee is optional.

Link to comment
10 minutes ago, Red_Dot_Design said:

Would you be able to advise how to do this or do you know of any relevant [age gate] plugins? 

We built an Age Verification extension specifically for Squarespace. Feel free to DM me if you have questions.

About me: I've been a SQSP User for 18 yrs. I was invited to join the Circle when it launched in 2016. I have been a Circle Leader since 2017. I don't work for Squarespace. I value honesty, transparency, diversity and good design ♥.
Work: I founded and run SF.DIGITAL, building Squarespace Extensions to supercharge your commerce website. 
Content: Views and opinions are my own. Links in my posts may refer to SF.DIGITAL products or may be affiliate links.
Forum advice is free. You can thank me by clicking one of the feedback emojis below. Coffee is optional.

Link to comment

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.