Support » Plugins » Concept: Only registered and logged in users see comments

  • Well, in nowadays you can choose whether you want to let unregistered users to comment in your WordPress blog. That’s cool enough. However, I needed to deny all access to comments unless a user is logged in.

    I did not find any answers, so I figured it out this way:
    I edited the comments.php file of Kubrick theme,

    added

    <?php get_currentuserinfo(); global $user_level; if ($user_level > 0) { ?>

    before line 22 (<?php if ($comments) : ?>)

    and

    <?php } ?>

    after line 61 (<?php endif; ?>)

    So basically I made comments in every article unvisible to users who are not above the user level 0. You can change ($user_level > 0) to whatever you need.

    Hope this helps someone, it’s a simple trick and a trick after all.

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Concept: Only registered and logged in users see comments’ is closed to new replies.