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

CSS to always show comments (Tudor template)

Question

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

Edited by AfroGunsou

Share this post


Link to post

7 answers to this question

Recommended Posts

  • 2

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


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




Edited by tazmeah
Initial Revision

Share this post


Link to post
  • 0

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.

Share this post


Link to post
  • 0

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

Share this post


Link to post
  • 0

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>





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