Loading post comments after clicking a button

Hello, can someone help me hide the comments form and show it when someone clicks a button?

This what’s I’m trying to hide: https://prnt.sc/Q4RXOb_n6XYT

I’ve found a snippet to show the comments on click, maybe we can change the code to work with the comments form as well.

function your_hidden_comments(){ ?>
<script type=”text/javascript” defer=”defer”>
var comment_div = jQuery(‘#comments’);
jQuery(‘<button id=”show_comments”>Show Comments</button>’).insertBefore(comment_div);
jQuery(‘#show_comments’).on(‘click’,function(){ comment_div.fadeIn(‘slow’); jQuery(‘#show_comments’).fadeOut(‘slow’); });}
<?php }

add_action(‘wp_footer’, ‘your_hidden_comments’);

This is a post of mine:

https://bestlistofporn.com/playboyplus (NSFW content)

Thank you in advance 🙂


This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer