<?php if (!is_user_logged_in()) { ?>
<p class="text-center">
برای ارسال نظر باید <a href="https://www. .com/login?redirect_to=<?php echo the_permalink();?>"><i class="fa fa-fw fa-sign-in"></i> وارد حساب کاربریتان شوید</a> یا <a href="/register"><i class="fa fa-fw fa-user-plus"></i> عضو سایت شوید</a>
<?php } ?>


    $comments = get_comments(array(
        'post_id' => get_the_ID(),
        'orderby' => 'comment_date',
echo wp_list_comments("callback=wpsaz_comment&end-callback=dubfa_div&per_page=5",$comments);

what is wrong with this code?

comments returns only when user is logged in.

how can i fix it?


If it is for the post, then check whether in the post settings have you allowed the comments should be displayed?

Also do check the settings at: /wp-admin/options-discussion.php



the problem was because of $comments, i removed that and fixed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.