Jump to content

Change site title link destination

Go to solution Solved by Lesum,

Recommended Posts

I have a landing page set as my home page, but once visitors enter, I'd like my site title (which is text based) to link to a different page. That is, I want  the home page to change to "work" once they get past the landing page.

Appreciate any help!

This question was posed earlier, but the code I found didn't work: 

<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>

<script>$(document).ready(function () {
          $(".site-title a[href]").attr("href", "/work");
        });
</script>
Link to comment
  • Replies 6
  • Views 1.2k
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

@dani_1011 You can try this code snippet:

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>

<script>
$(document).ready(function() {
    changeLink();
    function changeLink() {
            $('.header-title-text a').attr('href', 'https://www.youtube.com/');
    }
});
</script>

Replace "https://www.youtube.com/" in the code with the URL of the destination page (add entire URL, not just "/work")

Let me know how it goes. Thanks!

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?

Link to comment

@dani_1011 The code should have functioned properly. I tested it on a website. Could you possibly provide a screenshot of where you implemented the code? This will allow me to verify if there's an issue in the code placement.

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?

Link to comment
  • Solution

@dani_1011 Try the updated code below: 

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>

<script>
$(document).ready(function() {
    changeLink();
    function changeLink() {
            $('.logo a').attr('href', 'http://www.yasminediaz.com/work');
    }
});
</script>

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?

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.