• Resolved tomdy77

    (@tomdy77)


    Hi,

    On my blog: http://b-broker.pl I use HidePost Plugin.
    This plugin hide any part of my post but don’t hide a comments.

    I’m looking for a way to hide a comment from not logged readers. Only logged users can comment and ONLY logged users can VIEW existing comments – especially “only logged users can VIEW existing comments”.

    Thank you for your help 🙂

Viewing 8 replies - 1 through 8 (of 8 total)
  • Without using plugins, I’d probably turn to this

    //the loop stuff
    if(is_user_logged_in()){
      //comment stuff
    }
    //close loop stuff
    Thread Starter tomdy77

    (@tomdy77)

    Where exactly (in which file) I need to put this code?
    I pasted this in functions.php (in my theme folder) but that is not working…

    In every template file that has comments. Probably single.php and index.php. Might be others, depends.

    But don’t copy paste. This isn’t actual code. You need to insert the code where it says // … stuff.

    Thread Starter tomdy77

    (@tomdy77)

    It’s a “higher drive school” for me 🙂

    In single.php I have something like this:

    <?php if (('open' == $post-> comment_status) && ('open' == $post->ping_status)) {
    // Both Comments and Pings are open ?>
    You can <a href="#respond" rel="nofollow">leave a response</a>, or <a>" rel="trackback">trackback</a> from your own site.

    Can you write how should I change this code?

    Thread Starter tomdy77

    (@tomdy77)

    Maybe easier will be to use some code, for example:

    If user logged out (doesn’t logged in) he doesn’t see a comment…

    That would be the //comment stuff I mentioned. But it won’t be enough, you’ll also need the code that actually displays the comments.

    Thread Starter tomdy77

    (@tomdy77)

    I found this:
    http://stackoverflow.com/questions/11009734/how-to-display-loged-in-users-comments-only-on-wordpress

    I need a help. How can I use this in my Intrepidity Theme?

    Thread Starter tomdy77

    (@tomdy77)

    I decided to use wp-members plugin…

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘I need to hide a comments from not logged readers…’ is closed to new replies.