wpseek.com
Uma área de pesquisa sobre o WordPress para devs e autores do tema



in_the_loop › WordPress Function

Desde2.0.0
Obsoleton/a
› in_the_loop ( Sem parâmetros )
Retorna:
  • (bool) True if caller is within loop, false if loop hasn't started or ended.
Definido em:
Codex:

Determines whether the caller is in the Loop.

For more information on this and similar theme functions, check out the {@link https://developer.wordpress.org/themes/basics/conditional-tags/} article in the Theme Developer Handbook.


Fonte

function in_the_loop() {
	global $wp_query;

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

	return $wp_query->in_the_loop;
}