Jump to content

CSS to always show comments (Tudor template)

Recommended Posts

Posted

In the Tudor template, comments on pages are hidden and you have to click the "Leave a comment/ Show X comments" link to show the comment field and the comments. I am looking to make it so that those are displayed by default without the need to click on that link.

Anybody have any experience doing this either on Tudor, or even any other templates that do the same thing with comments, they could throw my way?

tia

  • 2 weeks later...
  • Replies 18
  • Views 1.8k
  • Created
  • Last Reply
Posted

Go to Settings / Advanced / Code Injection and copy-paste this in the Footer section:


<script>
document.getElementsByClassName("blog-item-comments-toggle")[0].click();
</script>




  • 3 months later...
Posted

I am trying to do the same on the 'Charlotte' template. I tried to use the same code bit it didn't seem to do anything. Any suggestions?

Thanks in advance.

  • 2 months later...
Posted

use your page inspector tool and look at the class name for the text that displays/hides the comments. If it's not .blog-item-comments-toggle then update that class name in the JS code supplied by tazmeah

  • 2 months later...
Posted

For those that want a slightly cleaner approach you should check for the existence of the element first. Otherwise you will get JS errors on pages that don't have a comment section. I think the best way would be to figure this out in CSS instead of JS but in the meantime this is a cleaner approach.


<script>
 var commentSection = document.getElementsByClassName("blog-item-comments-toggle");
 if (commentSection.length){
   commentSection[0].click();
 }
</script>





  • 4 months later...
  • 4 months later...
  • 2 years later...
Posted
On 11/2/2020 at 3:56 PM, Raflehaen said:

Is it possible to show the comments box in CSS? Would be great! 

I'm also using the Tudor template: https://www.plaatsmaker.be/artikels-blog/hoe-makers-groeien

Thanks in advance!

Add to Home > design > Custom CSS

#blogItemCommentsContent {
    opacity: 1 !important;
    height: auto !important;
}
label.blog-item-comments-toggle {
    display: none;
}
div#blogItemCommentsContent {
    pointer-events: auto;
}

 

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

Add to Home > design > Custom CSS


#blogItemCommentsContent {
    opacity: 1 !important;
    height: auto !important;
}
label.blog-item-comments-toggle {
    display: none;
}

 

Thanks @tuanphan! You made my day!

Posted
5 hours ago, tuanphan said:

Add to Home > design > Custom CSS


#blogItemCommentsContent {
    opacity: 1 !important;
    height: auto !important;
}
label.blog-item-comments-toggle {
    display: none;
}

 

As said, thank you very much!

I was happy to see the comment box as a default, but it's not possible to comment anymore.

Do you think we can do something about this?

Tnx!

  • 4 months later...
Posted
On 11/2/2020 at 11:54 AM, tuanphan said:

Add to Home > design > Custom CSS


#blogItemCommentsContent {
    opacity: 1 !important;
    height: auto !important;
}
label.blog-item-comments-toggle {
    display: none;
}

 

I've tried this code and it does display the comment box however it is not possible to type into it so commenting is technically disabled. Any suggestions?

Posted
On 3/23/2021 at 9:55 PM, Zineta said:

I've tried this code and it does display the comment box however it is not possible to type into it so commenting is technically disabled. Any suggestions?

Can you share link to a blog post? We can check it again 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
On 3/27/2021 at 8:31 PM, Zineta said:

I have removed the code since the comments didn't work. 

https://www.wearecravingadventure.com/blog/new-zealand/milford-sound

Hi. Use this new code

#blogItemCommentsContent {
    opacity: 1 !important;
    height: auto !important;
}
label.blog-item-comments-toggle {
    display: none;
}
div#blogItemCommentsContent {
    pointer-events: auto;
}

 

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

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.