Forums
Forums / Fixing WordPress / Unlogged user and comments
(@anup)
14 years, 11 months ago
Hi.
I am trying to hide comments by admin to unlogged users.
I am not sure, if it is simple or difficult.
<?php if (!is_user_logged_in() && is_post()) { get_comment( !user_id => '1' ); } else if (is_user_logged_in()) { get_comment(); } ?>
would placing such code at appropriate place in comments.php work? or does it need to be something more elaborate. Any help is appreciated.
The topic ‘Unlogged user and comments’ is closed to new replies.
(@anup)
14 years, 11 months ago
Hi.
I am trying to hide comments by admin to unlogged users.
I am not sure, if it is simple or difficult.
<?php if (!is_user_logged_in() && is_post()) { get_comment( !user_id => '1' ); } else if (is_user_logged_in()) { get_comment(); } ?>would placing such code at appropriate place in comments.php work? or does it need to be something more elaborate. Any help is appreciated.