Plugin doesn’t work because have_comments returns false
-
Hi,
The plugin wasn’t working on our site. Upon investigation it turns out that have_comments (on line 236 of class-llc-public.php) was returning false even though we had comments. I replaced it with get_comments_number:
} elseif ( ! ( get_comments_number() > 0 || 'open' == $post->comment_status ) ) {And now it works.
The codex says of have_comments:
Warning: this function will always return “false” until after comments_template has been called. If you need to check for comments before calling comments_template, use get_comments_number instead.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
The topic ‘Plugin doesn’t work because have_comments returns false’ is closed to new replies.