WordPress at a glance

have_comments() WP 1.0

Whether there are comments to loop over.

Works based on: WP_Query::have_comments()
1 time = 0.000001s = speed of light | 50000 times = 0.02s = 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() WP 5.6

<?php
function have_comments() {
	global $wp_query;
	return $wp_query->have_comments();
}

From tag: Comments

More from tag: Conditional tags (all)

More from category: Comments Loop

More from Template Tags: Comments

No comments
    Log In