Jump to content

Changing blog "Comments" to "Notes"

Go to solution Solved by tuanphan,

Recommended Posts

On 1/26/2023 at 8:52 AM, Rebecca365 said:

Add to Settings > Advanced > Code Injection > Footer

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
    $("h3.comment-count span").html(function() { 
          return $(this).html().replace("Comments", "Notes");  
    });
      $("span.comment-btn.sqs-system-button").html(function() { 
          return $(this).html().replace("Post Comment…", "Post");  
    });
});
</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

I tried this, and it hasn't changed anything. I put in the site settings, since the "Post Blog Item Code Injection" does not include a "Footer" setting.

Question: if the code could be placed in the "Post Blog Item Code Injection", would I be able to change the name of "comments" on my general blog, and remove comments on blogs in a member area?

Thank you!

Rebecca

 

 

 

Link to comment
22 hours ago, Rebecca365 said:

I tried this, and it hasn't changed anything. I put in the site settings, since the "Post Blog Item Code Injection" does not include a "Footer" setting.

Question: if the code could be placed in the "Post Blog Item Code Injection", would I be able to change the name of "comments" on my general blog, and remove comments on blogs in a member area?

Thank you!

Rebecca

 

 

 

No. Do not add to Post Blog Item Code Injection

Add to 

Home > Settings > Advanced > Code Injection > You will see Header, Footer, Lock Page, Order Confirmation Page... boxes > But you need to add to Footer box

Edited by tuanphan

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
On 1/28/2023 at 9:25 PM, Rebecca365 said:

 

I have done that, and I don't see a change.

<https://www.springboardmealplans.com/recipes/this-is-a-sample-blog-post>

 

Rebecca

Try this new code

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
   setTimeout(function(){
           $("h3.comment-count span").html(function() { 
          return $(this).html().replace("Comments", "Notes");  
    });
      $("span.comment-btn.sqs-system-button").html(function() { 
          return $(this).html().replace("Post Comment…", "Post");  
    });
         }, 5000);
});
</script>

image.thumb.png.5b6b3067e9f8d61d01bb76041dd508ee.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!)

Link to comment
  • Solution
17 hours ago, Rebecca365 said:

This worked! But with a lag. If you check the link, it will render with the word "Comments" and then -- Boom! -- it changes itself to "Notes". What do you think?

<https://www.springboardmealplans.com/recipes/this-is-a-sample-blog-post>

Yes. I set time to 5 seconds. You will see 5000 in the code. You can change it to 1000 or 2000

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

Blog comments are lazily loaded. You need a MutationObserver, a way to watch for elements to appear on the DOM, to know when the comments show up on the DOM and then apply an effect.

I know of no MO based code that currently does this on SS.

Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects.

Link to comment
  • 2 weeks later...

If you don't necessarily want the comment count then this code should work in config/design/custom css

 

h3.comment-count span {
    visibility: hidden;
}
h3.comment-count span:before {
    visibility: visible;
    content: "Notes";
}

It works on my site, I changed comments (0) to Have a comment? 

Edited by derricksrandomviews
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.