dani_1011 Posted August 31 Share Posted August 31 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
Lesum Posted September 1 Share Posted September 1 @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
Lesum Posted September 1 Share Posted September 1 @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 Lesum Posted September 1 Solution Share Posted September 1 @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
dani_1011 Posted September 1 Author Share Posted September 1 that worked! thank you so much Lesum, you're a life-saver 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