Jump to content

Change Link on Site Header Logo

Recommended Posts

Site URL: https://hannahrushton.com/portrait-photography

I had a code for a fix on my website that has stopped working. Essentially, I had certain pages where the logo would re-direct to hannahrushton.com/portrait-photography so that I can have two separate sections of my website for food photography and then for portrait photography. Basically when you would be on any of the pages on the portrait photography side, the logo would revert to hannahrushton.com/portrait-photography and if you were on any pages on the food photography side the logo would revert to hannahrushton.com. Before I had just typed in my logo using a font on Squarespace, but I recently changed to using an image for the logo and that's when the redirect I fashioned stopped working. Here's the code I was using to make the change. I just had this on every page that needed to be redirected to the portrait photography home page (/portrait-photography). Please let me know if you have any fixes that would work for me! This code is courtesy of Tuan Phan and he was amazing to help!

 

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.0/jquery.min.js"></script>
<script>
$(document).ready(function() {
    $('.site-branding [href="/"]').attr('href','/portrait-photography');
});
</script>

Link to comment
  • Replies 0
  • Views 272
  • Created
  • Last Reply

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.