Jump to content

Header code to show different Button text/link on a different page?

Go to solution Solved by tuanphan,

Recommended Posts

Hi.

I have a header on site with usual Nav items. Links, logo and CTA button.

What shows on my homepage header, I want to tweak slightly for a different page. 

I have done this with the logo. So you can see the logo on homepage is different if you go to The Mental Kitchen page. I did this with code on that page.

I want a similar code but for the button and to change the telephone number and call now url to the new number.

 

Possible?

Link to comment
  • Replies 6
  • Views 274
  • Created
  • Last Reply

Top Posters In This Topic

Hi. https://thedepartmentalstore.co.uk/

 

So I want the button top right to show a different phone number and call link on this page: https://thedepartmentalstore.co.uk/the-mental-kitchen-mold

As you can see the Mental Kitchen page has a different logo to the homepage. So now I just need the CTA button show the relevant phone number/url for that part of the business.

 

Thanks, Will.

Link to comment
On 1/17/2023 at 11:34 PM, ynwa2018liv said:

Hi. https://thedepartmentalstore.co.uk/

 

So I want the button top right to show a different phone number and call link on this page: https://thedepartmentalstore.co.uk/the-mental-kitchen-mold

As you can see the Mental Kitchen page has a different logo to the homepage. So now I just need the CTA button show the relevant phone number/url for that part of the business.

 

Thanks, Will.

On this page, https://thedepartmentalstore.co.uk/the-mental-kitchen-mold

you want

  • Change to another phone number

Is that right?

Do you use Personal, Business or Commerce Plan?

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment
  • Solution
On 1/22/2023 at 2:15 AM, ynwa2018liv said:

Hi. Yes, I want the CTA button to be a different number and link to a different call url.

 

It is a Business plan.

Add this code to The Mental Kitchen Mold Page Header

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.1/jquery.min.js"></script>
<script>
$(document).ready(function() { 
		$('header#header a.btn').attr('href','tel:0123456789');
   $("header#header a.btn").html(function() { 
          return $(this).html().replace("Call Us 07889859941", "Call Us 0123456789");  
    });
	});
</script>

 

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment
  • 1 month later...

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.