wpseek.com
A WordPress-centric search engine for devs and theme authors



have_posts › WordPress Function

Since1.5.0
Deprecatedn/a
have_posts ( No parameters )
Returns:
  • (bool) True if posts are available, false if end of the loop.
Defined at:
Codex:

Determines whether current WordPress query has posts to loop over.



Source

function have_posts() {
	global $wp_query;

	if ( ! isset( $wp_query ) ) {
		return false;
	}

	return $wp_query->have_posts();
}