Jump to content

Remove "comma" between blog meta data tags

Recommended Posts

Site URL: https://bywater-collective.squarespace.com/photography-journal/madi-garrett

Hey y'all - I'm using blog tags as way to target blog post for unique CSS application, and therefore have set the post to hide the names of these specific tags when displayed on the blog post header. However, this javascript is no longer hiding the loose comma that appears, between the visible tag, and the hidden and I'm not sure why.... Would appreciate any help! TIA!

Note - would only like to remove commas of the meta item tag, not category

 

<script> 
  $('.Blog-meta-item .Blog-meta-item--tags').map(function(val, i) {
    this.innerHTML = this.innerHTML.replace(/,/g, ' ');
})
</script>

 

Site: https://bywater-collective.squarespace.com/photography-journal/madi-garrett

PW: byctest

Link to comment
  • Replies 4
  • Views 1.3k
  • Created
  • Last Reply
On 8/4/2021 at 10:21 AM, MayaViolet said:

Site URL: https://bywater-collective.squarespace.com/photography-journal/madi-garrett

Hey y'all - I'm using blog tags as way to target blog post for unique CSS application, and therefore have set the post to hide the names of these specific tags when displayed on the blog post header. However, this javascript is no longer hiding the loose comma that appears, between the visible tag, and the hidden and I'm not sure why.... Would appreciate any help! TIA!

Note - would only like to remove commas of the meta item tag, not category

 

<script> 
  $('.Blog-meta-item .Blog-meta-item--tags').map(function(val, i) {
    this.innerHTML = this.innerHTML.replace(/,/g, ' ');
})
</script>

 

Site: https://bywater-collective.squarespace.com/photography-journal/madi-garrett

PW: byctest

Whre did you add the code? Can you take screenshot of tags? I dont see tags here

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
10 hours ago, tuanphan said:

Whre did you add the code? Can you take screenshot of tags? I dont see tags here

Yes - the tag is actually the date beneath the title, "Nov 20 2020" then the comma, then a hidden tag titled "dark-light" that applies a CSS rule to keep the title dark text, and the intro paragraph light text.

 

I applied the code in the Header Injection for the entire site, as well as in the Page Header Code Injection and the Post Blog Item Code Injection in attempt to get it to work!

Screen Shot 2021-08-05 at 10.14.35 AM.png

Link to comment
On 8/6/2021 at 12:22 AM, MayaViolet said:

Yes - the tag is actually the date beneath the title, "Nov 20 2020" then the comma, then a hidden tag titled "dark-light" that applies a CSS rule to keep the title dark text, and the intro paragraph light text.

 

I applied the code in the Header Injection for the entire site, as well as in the Page Header Code Injection and the Post Blog Item Code Injection in attempt to get it to work!

Screen Shot 2021-08-05 at 10.14.35 AM.png

Add to Design > Custom CSS

/* Hide tags comma */
span.Blog-meta-item.Blog-meta-item--tags {
    visibility: hidden;
}
span.Blog-meta-item.Blog-meta-item--tags a {
    visibility: visible;
}

 

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

Archived

This topic is now archived and is closed to further replies.


×
×
  • 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.