Jump to content

Replace inner HTML to change navigation page title

Recommended Posts

Posted

Hello! I am trying to change the navigation page title for "HOME" on only 2 pages of my site, specifically in mobile view. I just want to replace the text, the URL remains the same.

https://www.designedbycarolyn.co/agency

https://www.designedbycarolyn.co/about-a

Desktop view does not matter since I have hidden the header and replaced it with a custom coded one. Nevertheless, I believe changing the text for desktop view (.header-nav-item--homepage) will affect the mobile view as well so either way works.

I have tried using jQuery and inserting it in the Page Advanced code section but it didn't work...

<script>
var url = $(‘div.header-nav-item--homepage a.’preFade.fadeIn).attr('href')
url = url.replace(‘HOME’, MY FULL SITE’)
$('.header-nav-item--homepage').attr('href', https://designedbycarolyn.co/)
</script>

Thank you so much in advance!

  • Replies 0
  • Views 71
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

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.