WordPress at a glance

in_the_loop() WP 1.0

Whether the caller is in the Loop.

  • Global. WP_Query. $wp_query Global WP_Query instance.

No Hooks.

Return

true/false. True if caller is within loop, false if loop hasn't started or ended.

Usage

in_the_loop();

Code of in_the_loop: wp-includes/query.php VER 4.9.8

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

Related Functions

From tag: Conditional tags (all)

More from category: Queries

More from Template Tags: Posts, Pages, ...

No comments
    Hello, !     Log In . Register