A WordPress-centric search engine for devs and theme authors



in_the_loop ›

Since2.0.0
Deprecatedn/a
in_the_loop ( No parameters )
Returns:
  • (bool) True if caller is within loop, false if loop hasn't started or ended.
Defined at:
Codex:

Determines whether the caller is in the Loop.

For more information on this and similar theme functions, check out the Conditional Tags article in the Theme Developer Handbook.


Source

function in_the_loop() {
	global $wp_query;
	return $wp_query->in_the_loop;
}