Jump to content

Change Social Icon Email Link

Go to solution Solved by tuanphan,

Recommended Posts

I would like to change the default link of mailto:info@website.com.au
to a link to the Contact Us page. Because I'm getting a lot of spam emails asking for SEO optimization 😕

I've already changed the text in the footer to images, but I still got some today.

I know this doubles up as a Contact Us button, but I like to have the mail icon in the top right hand corner.

_
On another note, any tips to avoid these spam emails?

any help would be appreciated.
 

Edited by drunkbeetle
Link to comment

Add to Website > Website Tools > Code Injection > Footer (DO NOT add to Custom CSS)

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>
<script>
$(document).ready(function(){
	$('header#header a.icon').attr('href','/contact');
});
</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
Posted (edited)

Thank you very much Tuan! It worked like a charm!

Can you tell me, how do you decide if this code goes into the header, footer or custom css?

Oh also, is it possible to hide that mail Icon on the Contact page?

Edited by drunkbeetle
Link to comment
  • Solution
On 3/3/2024 at 7:04 PM, drunkbeetle said:

Thank you very much Tuan! It worked like a charm!

Can you tell me, how do you decide if this code goes into the header, footer or custom css?

Oh also, is it possible to hide that mail Icon on the Contact page?

With Custom CSS, the code format will be like this

id/class name {
	CSS value;
}

Code Injection Header/Footer, the code format will be like this

<style>
  CSS code
</style>

or

<script>
  JS code
</script>

or

<link rel="stylesheet" href="url" />

With <style>, usually add to Code Injection Header

<script> will be Code Injection Footer

(but you insert it in Header or Footer, it will also run)

With Contact Page, add this code to Contact Page Header Code Injection

<style>
  header#header a.icon[href*="contact"] {
  	display: none !important;
  }
</style>

Page Header1 Min

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

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.