Jump to content

[Share] Secondary Navigation with Text/Phone (Icon)/Address (Icon)

Recommended Posts

Posted

In this post, I will share how to create a secondary navigation (above header) with layout like this.

image.thumb.png.bb2c119fa52eaa03efe045742aa15be6.png

If you can't make it work, you can send site url in comment or message me, I can check easier.

#1. First, you need to enable Announcement Bar.

image.thumb.png.85e0189ad7101878fba2f14edec5d4ac.png

image.thumb.png.5be2c5f4bbbbf15ec6dad39b64eb2e65.png

#2. Next, add 3 text like this

image.png.cba35b5a4709f7023a18ce867a4f9972.png

#3. Highlight phone text >> Add a phone number with this format

tel:0123456789

image.png.20f4eaef6a64beafee34b1d7af0ddfcd.png

and highlight address >> Add this symbol to URL

#

image.png.8c9a7bbd0a2bd2bf1d54fce131d897cc.png

#4. Edit Site Footer > Add a Code Block > Paste this code

(Note: Code Block is available in Personal Plan, and this code can run on Personal Plan)

If you use a Business Plan or higher, you can use code to Code Injection > Header

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.1/css/all.min.css" integrity="sha512-KfkfwYDsLkIlwQp6LFnl8zNdLGxu9YAA1QvwINks4PhcElQSvqcyVLLD9aMhXd13uQjoXtEKNosOWaZqXgel0g==" crossorigin="anonymous" referrerpolicy="no-referrer" />

image.png.020b418d4e59606ef860aca41e98d264.png

#5. Use this code to Custom CSS to add Phone/Address Icons before Phone/Address text.

The code also remove underline from Phone/Address.

div#announcement-bar-text-inner-id {
   /* remove links underline */
  p a {
    text-decoration: none !important;
}
  /* Phone */
  p a[href*="tel"]:before {
    content: "\f095";
    font-family: "Font Awesome 6 Free";
    font-weight: bold;
    margin-right: 5px;
    margin-left: 20px;
}
  /* Address */
  p a[href="#"]:before {
    content: "\f3c5";
    font-family: "Font Awesome 6 Free";
    font-weight: bold;
    margin-right: 5px;
    margin-left: 20px;
}
}

You will have this.

image.thumb.png.17269cb4d3b15cb3bc90ee5930823663.png

#6. To make them align right, you can use this CSS code

div#announcement-bar-text-inner-id p {
    text-align: right;
  }

#7. To stacked 3 texts on mobile, use this code 

div#announcement-bar-text-inner-id {
  @media screen and (max-width:767px) {
    p a {
      display: inline-block;
    }
    p {
      line-height: 22px;
    }
  }
}

image.png.6e183eb5d28f62e7d8239b480db3f86a.png

#8. To change the Announcement Bar background, you can change the Site Style.

image.png.a3daec8a85ff2d2a58ac5e5910698b43.png

#9. To remove the Announcement Bar X Close icon, you can use this CSS code

span.sqs-announcement-bar-close {
    display: none;
}

image.png.9ac36e6992fcba80639015fae69f9599.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!)

  • 4 months later...
  • Replies 5
  • Views 1.2k
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

Posted

Is there any way for the content in the second navigation to be split...some items on the left and some on the right? Thanks.

Posted
6 hours ago, MColeman said:

Is there any way for the content in the second navigation to be split...some items on the left and some on the right? Thanks.

Yes, we can use some CSS float to do this. You can share link to your site, I can check & give code easier.

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)

Thanks. Currently I have the second navigation set up with Will Myers code (here), but then I saw your suggestion of using the announcement bar. I can change it to the announcement bar if you think that is better with less CSS overall to make it happen. I mainly chose the Will Myers code so I could hide it on mobile. Regardless, the website is pronet.squarespace.com, password is honeyroad. I was hoping for the phone on the left and the links on the right. Thanks for the help!

Edited by MColeman
Posted
43 minutes ago, MColeman said:

I have the second navigation set up with Will Myers code. I was hoping for the phone on the left and the links on the right.

@MColeman Add this to the end of Custom CSS:

/* Align first subnav item to the left */
#wm-subnav .header-nav-item:first-of-type {
  margin-left: .8vw;
  margin-right: auto;
}

Did this help? Please give feedback by clicking an icon below  ⬇️

Me: I'm Paul, a SQSP user for >18 yrs & Circle Leader since 2017. I value honesty, transparency, diversity and good design ♥.
Work: Founder of SF.DIGITAL. We provide high quality original extensions to supercharge your Squarespace website. 
Content: Views and opinions are my own. Links in my posts may refer to my own SF.DIGITAL products or may be affiliate links.
Forum advice is completely free. You can thank me by selecting a feedback emoji. Buying a coffee is generous but optional.

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.