have_comments()
Whether there are comments to loop over.
1 time — 0.000001 sec (speed of light) | 50000 times — 0.02 sec (speed of light) | PHP 7.1.5, WP 4.9.2
No Hooks.
Return
true|false
. True if comments are available, false if no more comments.
Usage
have_comments();
Notes
- Global. WP_Query. $wp_query WordPress Query object.
Changelog
Since 2.2.0 | Introduced. |
Code of have_comments() have comments WP 5.9.3
function have_comments() { global $wp_query; return $wp_query->have_comments(); }