in_the_loop

Whether the caller is in the Loop.

Description

in_the_loop(); 

Usage

  1. if ( !function_exists( 'in_the_loop' ) ) { 
  2. require_once ABSPATH . WPINC . '/query.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = in_the_loop(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/wp-includes/query.php  
  1. function in_the_loop() { 
  2. global $wp_query; 
  3. return $wp_query->in_the_loop;