Archived topic
Hide all comments from all logged out users
3 replies · Started by Dominik on October 23, 2016
Hi I would love to hide all comments (the comment functions completely) from all logged out users, such as shown here: http://wpsites.net/web-design/hide-comments-logged-out-users/
Example Page: https://dotzauerinstitut.de/uebungen/klimmzuege/
I'm a GP Premium customer - should/can I use hooks? What's the best solution for this issue?
Thank you!
Hi there,
It's possible, but takes a little coding.
First, copy the comments.php file into your child theme.
Then find this line:
// No direct access, please
if ( ! defined( 'ABSPATH' ) ) exit;
And put this after it:
if ( is_user_logged_in() ) :
Then at the very end of the file, find this line:
</div><!-- #comments -->
And put this after it:
<?php endif; ?>
Hope this helps :)
Thank you! Works great: https://dotzauerinstitut.de/uebungen/dips/
Awesome :)