Jump to content

Add 3 Call to action buttons to header 7.1

Go to solution Solved by tuanphan,

Recommended Posts

Posted

Hi, 

Creating a new business website & have it on a business plan. 

We have 3 social media icons on the left hand side of the header navigation bar and would like to add 3 call to action icons on the right hand side.

I can turn on the one button for the right hand side,  but is there anyway of adding 3 icons for buttons instead?

Am running the navigation with a split nav either side of a central logo.

Thanks
Andi

Posted

Some solutions to do this

Option 1. Use CSS code to turn last 3 items from Navigation to button style, then next use CSS position absolute to push them to right of footer

Option 2. Use JavaScript code to add 2 buttons to right of header + enable one button

If you share link to your site, we can give code for option 2 (You need to provide button name + button url)

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!)

Posted (edited)

Hi, 

Thanks for your response - Ideally I'm preferring option 2.

3 Buttons: - 

<i class="fa-solid fa-location-dot" style="color: #ffffff;"></i>

<i class="fa-solid fa-envelope" style="color: #ffffff;"></i>

<i class="fa-solid fa-phone" style="color: #ffffff;"></i>

When clicking on each button I'd like the actions to launch the below.

Location - https://maps.app.goo.gl/cPDj68KXYN52zhYE7

Email - hello@innovecom.com

Phone - +441172350000

Website - https://flute-opossum-zdac.squarespace.com/

Password - innovecom

Attached a mockup of what I'm ideally aiming for.

Many thanks

Andi

image002.png

Edited by andi.proact
  • Solution
Posted

Add this code to Website Tools (under Not Linked) > Code Injection > Footer

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>
<script>
  jQuery(document).ready(function($){
  $('<a class="tp-phone" href="tel:+441172350000"><i class="fa-solid fa-phone" style="color: #ffffff;"></i></a>').appendTo('.header-actions-action.header-actions-action--cta');
$('<a class="tp-email" href="mailto:hello@innovecom.com"><i class="fa-solid fa-envelope" style="color: #ffffff;"></i></i></a>').insertBefore('.tp-phone');
$('<a class="tp-location" href="https://maps.app.goo.gl/cPDj68KXYN52zhYE7" target="_blank"><i class="fa-solid fa-location-dot" style="color: #ffffff;"></i></a>').insertBefore('.tp-email');
})
</script>
<style>
  .tp-email {
    margin-left: 15px;
    margin-right: 15px;
}
</style>

image.thumb.png.d06db39fe5d99a01ae275f306d0c981a.png

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!)

Posted

Hi,

Thanks so much for your quick response, this has worked perfectly.

I just have one more question around this if you don't mind. By turning the CTA button on it's required for the icons to appear, however it obviously still keeps the call us section I had put in - Deleting the text removes it from the screen but still leaves the link & rollover button there if I move the cursor over it.

Is there any way of stopping that happening?

Thanks again

Andi

Posted
On 12/5/2023 at 5:02 PM, andi.proact said:

Hi,

Thanks so much for your quick response, this has worked perfectly.

I just have one more question around this if you don't mind. By turning the CTA button on it's required for the icons to appear, however it obviously still keeps the call us section I had put in - Deleting the text removes it from the screen but still leaves the link & rollover button there if I move the cursor over it.

Is there any way of stopping that happening?

Thanks again

Andi

Add this to Website Tools > CUSTOM CSS to remove it

div.header-actions-action a.btn:first-child {
    display: none !important;
}

 

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!)

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.