WordPress.org

Ready to get started?Download WordPress

Forums

Commenter ID (4 posts)

  1. aloncarmel
    Member
    Posted 8 years ago #

    Hello ,
    I need help in a small issue ,
    How do i get the Commenter ID in the comment loop? Ofcourse if the user is registered .

    user_id or author doesnt work .

  2. $comment->user_id should give you the user id for registered users or 0 for unregistered users with the comment loop in comments.php

  3. aloncarmel
    Member
    Posted 8 years ago #

    works thanks !

  4. José Luís
    Member
    Posted 7 years ago #

    Hello, I tried this solution comparing it to zero (0) to test if the author is a registered user:

    global $comment;
    if($comment->user_id == 0)
    {here goes the rest of the code}

    I also tried comparing it to '0':

    global $comment;
    if($comment->user_id == '0')
    {here goes the rest of the code}

    But both tests always result false. Can you help me?

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.