WordPress at Your Fingertips

have_comments() WP 1.0

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() WP 5.8

<?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