Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Advanced Search
noblescott

Hiding a Social link in a Social block.

Recommended Posts

Hi guys. Hoping someone can help here. I have a site where I've added a social block. Without going into too much detail why, I need to have 2 different Facebook links but only show one or the other on certain pages. Does anyone know the CSS required to hide either first or last one? I have it as Facebook, Twitter, Facebook. Or, if anyone knows another way to do this, that would be great. I thought I could just put a different social block on the different pages but it recognises the existing Connections.

Thanks in advance.

Share this post


Link to post

Thanks @tuanphan Page is here...https://peebles-community.squarespace.com/pct and password is community. It's the social icons you can see under the banner. I'm just not sure what CSS to use to hide the different icons in the main the last one (which I want to hide on this page) and the first one (which will be hidden on another page), so any help is appreciated.

Thanks in advance.

Share this post


Link to post

Hi again @tuanphan. Sorry to ask another question but it's kind of related. In mobile view I'm trying to hide the secondary navigation elements and using the method you used above I  can't seem to target the relevant children, ie 9, 10, 11 and 12. I managed to test it out with the primary nave elements and it hides them. Do I somehow need to target that this is secondary nav in the CSS somehow? In Google Developer mode it all seems to be lumped in together, ie .Mobile-overlay-nav-item. Thanks again for your help.

Share this post


Link to post

@noblescott

home item is .Mobile-overlay-nav--secondary button

with other items, you can also use 

.Mobile-overlay-nav--secondary .Mobile-overlay-nav-item[href="/projects-1"]

.Mobile-overlay-nav--secondary .Mobile-overlay-nav-item[href="/community-council-members"]

.Mobile-overlay-nav--secondary .Mobile-overlay-nav-item[href="/contact-us-1"]

or

community item: .Mobile-overlay-nav--secondary .Mobile-overlay-nav-item:nth-child(2)
project: .Mobile-overlay-nav--secondary .Mobile-overlay-nav-item:nth-child(3)
contact us: .Mobile-overlay-nav--secondary .Mobile-overlay-nav-item:nth-child(4)

 

Edited by tuanphan

You can send your question to my email to get faster answer.

How to Setup Password & Share URL - Free Templates - Free Code - CSS ID List

Share this post


Link to post
On 10/29/2019 at 7:40 PM, tuanphan said:

@noblescott Add to Home > Design > Custom CSS


/* hide last icon */
body#collection-5d80b6e6c70a192412ac1abb nav.sqs-svg-icon--list a:last-child {
    display: none;
}

body#collection....bb is PCT Page ID

does this work in any template? I would like to do the same thing but my buttons are in the footer. thanks!

Edited by LucyBrookes

Share this post


Link to post

@LucyBrookes I have (2) locations that I'm including separate addresses to in my footer. I'd like to include social blocks under each addresses that would link to each locations unique facebook page url. BOTH are included side-by-side in the footer, but I want to add CSS if possible to redirect one link to a different facebook page. Any assistance appreciated!!

https://thefatdonkey2020.squarespace.com

Share this post


Link to post
Posted (edited)
7 hours ago, colehensley said:

@LucyBrookes I have (2) locations that I'm including separate addresses to in my footer. I'd like to include social blocks under each addresses that would link to each locations unique facebook page url. BOTH are included side-by-side in the footer, but I want to add CSS if possible to redirect one link to a different facebook page. Any assistance appreciated!!

https://thefatdonkey2020.squarespace.com

Difficult to help without site url

Also CSS can't change Link, maybe you need jQuery/JavScript

Edited by tuanphan

You can send your question to my email to get faster answer.

How to Setup Password & Share URL - Free Templates - Free Code - CSS ID List

Share this post


Link to post

@tuanphan

Hello,

how could I modify this code

body#collection-5d80b6e6c70a192412ac1abb nav.sqs-svg-icon--list a:last-child {
    display: none;
}

to do the opposite thing? Like displaying ONLY the last or nth-icon?

Thank you

Share this post


Link to post
20 hours ago, Angelo22 said:

@tuanphan

Hello,

how could I modify this code


body#collection-5d80b6e6c70a192412ac1abb nav.sqs-svg-icon--list a:last-child {
    display: none;
}

to do the opposite thing? Like displaying ONLY the last or nth-icon?

Thank you

Show Only last item

body#collection-5d80b6e6c70a192412ac1abb nav.sqs-svg-icon--list a:not(:last-child) {
    display: none;
}

Show only nth-icon

/* Hide all icons */
body#collection-5d80b6e6c70a192412ac1abb nav.sqs-svg-icon--list a {
    display: none;
}
/* Remove - hide nth icon */
body#collection-5d80b6e6c70a192412ac1abb nav.sqs-svg-icon--list a:nth-child(5) {
    display: block;
}

 


You can send your question to my email to get faster answer.

How to Setup Password & Share URL - Free Templates - Free Code - CSS ID List

Share this post


Link to post

@tuanphan Thank you for your answer it worked like charm.

Let me be more specific. I am building a music label website and the subpages are the artists so I want to display different social blocks on each page. I have connected them all in Social Links and with your code I decide what to display each time. Can I have multiple chlids inside the brackets? I have many social accounts and I want to avoid using so much code.

Or is there any more clever way to do it?

Thank you 

Share this post


Link to post
Posted (edited)
18 hours ago, Angelo22 said:

@tuanphan Thank you for your answer it worked like charm.

Let me be more specific. I am building a music label website and the subpages are the artists so I want to display different social blocks on each page. I have connected them all in Social Links and with your code I decide what to display each time. Can I have multiple chlids inside the brackets? I have many social accounts and I want to avoid using so much code.

Or is there any more clever way to do it?

Thank you 

You can create Social Blocks code with Code Block.

Then in each page, inset above code > and replace social icons url. ✌️

I Solved a smiliar post, searching again..

Edited by tuanphan

You can send your question to my email to get faster answer.

How to Setup Password & Share URL - Free Templates - Free Code - CSS ID List

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment


×
×
  • Create New...